在JavaScript程序中整合Java函数 - 编程入门网
作者 佚名技术
来源 NET编程
浏览
发布时间 2012-06-22
BufferedReader(new InputStreamReader(new FileInputStream(s1))); String s2; while((s2 = bufferedreader.readLine()) != null) { int i; while((i = s2.indexOf("java.")) > 0) { String s3 = s2.substring(0, i) + "parent." + "hframe" + ".javabridge(''"; String s4; for(s4 = s2.substring(i + "java.".length()); s4.length() > 0; s4 = s4.substring(1)) { if(s4.charAt(0) == ''('') { s3 = s3 + "''"; s4 = s4.substring(1); break; } s3 = s3 + s4.substring(0, 1); } if(needComma(s4)) s3 = s3 + ","; s2 = s3 + s4; } printwriter.println(s2); } bufferedreader.close(); } catch(Exception _ex) { printwriter.println("不能读取数据文件" + s1); } printwriter.flush(); printwriter.close(); } file://取得隐藏帧 private void getHiddenFrame(HttpServletRequest httpservletrequest, HttpServletResponse httpservletresponse) throws IOException { String s = getId(); file://取得ID PrintWriter printwriter = httpservletresponse.getWriter(); httpservletresponse.setContentType("text/html"); file://调用applet bridge printwriter.println("<html>"); printwriter.println("<applet code="bridge.class" codebase="" + CODEBASE + "" width=10 height=10>"); printwriter.println("<param name="servlet" value="" + getUrl(httpservletrequest) + "">"); printwriter.println("</applet>"); printwriter.println("<script language="JavaScript">"); printwriter.println("function javabridge(fName)"); printwriter.println("{"); printwriter.println(" var s='''';"); printwriter.println(" if (fName==''jinj.rewriteURL'' && javabridge.arguments.length>2)"); printwriter.println(" {"); printwriter.println(" if (javabridge.arguments.length==3)"); printwriter.println(" return rewriteURL(javabridge.arguments[1],javabridge.arguments[2]);"); printwriter.println(" else"); printwriter.println(" return rewriteURL(javabridge.arguments[1],javabridge.arguments[2],javabridge.arguments[3]);"); printwriter.println(" }"); printwriter.println(" for (i=1;i<javabridge.arguments.length;i++)"); printwriter.println(" { if (s!='''') { s+=''@# |
凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢! |
你可能对下面的文章感兴趣
关于在JavaScript程序中整合Java函数 - 编程入门网的所有评论