在JavaScript程序中整合Java函数 - 编程入门网
作者 佚名技术
来源 NET编程
浏览
发布时间 2012-06-22
= class1.getMethod(s1, (Class[])aobj1[0]); Object obj2 = method.invoke(obj, (Object[])aobj1[1]); if(method.getReturnType().getComponentType() == null) { String s6 = method.getReturnType().toString(); if(s6.indexOf("java.util.Vector") > 0)//判断s6中是否有java.util.Vector { if(obj2 == null) { s4 = ""; } else { Vector vector = (Vector)obj2; if(vector.size() == 0) { s4 = ""; } else { for(int j = 0; j < vector.size(); j++) { s4 = s4 + "@#contentquot;; s4 = s4 + (String)vector.elementAt(j); } } } } else if(s6.indexOf("java.util.Enumeration") > 0) { if(obj2 == null) { s4 = ""; } else { Enumeration enumeration = (Enumeration)obj2; if(!enumeration.hasMoreElements()) s4 = ""; else while(enumeration.hasMoreElements()) { s4 = s4 + "@#contentquot;; s4 = s4 + (String)enumeration.nextElement(); } } } else if(obj2 == null) s4 = ""; else s4 = String.valueOf(obj2); } else { for(int k = 0; k < Array.getLength(obj2); k++) { s4 = s4 + "@#contentquot;; if((obj = Array.get(obj2, k)) != null) s4 = s4 + obj; } } } else { Method method1 = class1.getMethod(s1, null); Object obj3 = method1.invoke(obj, null); if(method1.getReturnType().getComponentType() == null) { String s7 = method1.getReturnType().toString(); if(s7.indexOf("java.util.Vector") > 0) { if(obj3 == null) { s4 = ""; } else { Vector vector1 = (Vector)obj3; if(vector1.size() == 0) { s4 = ""; } else { for(int l = 0; l < vector1.size(); l++) { s4 = s4 + "@#contentquot;; s4 = s4 + (String)vector1.elementAt(l); } } } } else if(s7.indexOf("java.util.Enumeration") > 0) { if(obj3 == null) { s4 = ""; } else { Enumeration enumeration1 = (Enumeration)obj3; if(!enumeration1.hasMoreElements()) s4 = ""; else while(enumeration1.hasMoreElements()) { s4 = s4 + "@#contentquot;; s4 = s4 + (String)enumeration1.nextElement(); } } } else if(obj3 == null) s4 = ""; else s4 = String.valueOf(obj3); } else { for(int i1 = 0; i1 < Array.getLength(obj3); i1++) { s4 = s4 + "@#contentquot;; Object obj1; if((obj1 = Array.get(obj3, i1)) != null) s4 = s4 + obj1; } } } } catch(Exception _ex) { s4 = "不能从类 "+ class1.getName()+ "中调用"+ s1; } if(s4 == null) s4 = ""; } PrintWriter printwriter = httpservletresponse.getWriter(); httpservletresponse.setContentType("text/html"); printwriter.println(s4); printwriter.flush(); printwriter.close(); } private void getMainFrame(String s, HttpServletRequest httpservletrequest, HttpServletResponse httpservletresponse) throws IOException { PrintWriter printwriter = httpservletresponse.getWriter(); String s1 = getFromQuery(s, "df="); file://取得数据文件所在的路径和文件名 httpservletresponse.setContentType("text/html"); if(s1.length() == 0) printwriter.println("<html><br>不能打开数据文件</html>"); else try { file://打开数据文件 BufferedReader bufferedreader = new |
凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢! |
你可能对下面的文章感兴趣
关于在JavaScript程序中整合Java函数 - 编程入门网的所有评论