我能将这个JAR包解压出来用吗?
例如
<APPLET CODE = "com.genersoft.report.applet.StartApplet.class" JAVA_CODEBASE = "." WIDTH = "100%" HEIGHT = "97%" NAME = "reportDefine.jar" ALIGN = "middle" VSPACE = "0" HSPACE = "0">我将JAR包解压出来然后用
<APPLET CODE = "com.genersoft.report.applet.StartApplet.class" JAVA_CODEBASE = "." WIDTH = "100%" HEIGHT = "97%" ALIGN = "middle" VSPACE = "0" HSPACE = "0">这样能执行吗?
例如
<APPLET CODE = "com.genersoft.report.applet.StartApplet.class" JAVA_CODEBASE = "." WIDTH = "100%" HEIGHT = "97%" NAME = "reportDefine.jar" ALIGN = "middle" VSPACE = "0" HSPACE = "0">我将JAR包解压出来然后用
<APPLET CODE = "com.genersoft.report.applet.StartApplet.class" JAVA_CODEBASE = "." WIDTH = "100%" HEIGHT = "97%" ALIGN = "middle" VSPACE = "0" HSPACE = "0">这样能执行吗?
解决方案 »
- 新手求助(急)
- wsad中,jsp页面无法解析el和jstl表达式?求解,心力交瘁!
- 在tomcat中,让应用使用自己定义的类加载器,100分,在线等
- vtd-xml中遇到的一个问题
- 用JDOM读取XML文件,怎么能按照字段排序?
- 部署EJB时候出的问题
- 学习java的迷芒!
- 刚买了本J2ee应用与Bea WebLogic Server,将光盘弄掉了,那位GG、JJ、MM们如果有这本书的原代码,请发一份给我([email protected])非
- EJB?
- struts2里action变量问题
- resin3.1.3配置连接池,通过hibernate访问数据库失败,而resin3.0.19成功,怎么解决?
- struts2 框架 默认验证失效问题
第一个问题:我在本机运行一JAR包中的APPLET程序,但出现一问题如果此程序在同事的WEBLOGIC的环境下能正常运行,而在我机子上的WebSphere的环境下运行就经常出现 eofexeption 异常,此异常还是那种无规律的出现,有时能运行,有时报错,我现在想请教各位,这是属于程序问题,还是属于机器配置环境的问题呢?我反编译了下他的程序,我怀疑是不是此方法处理有问题呢? private Object getData(Object outObject) throws ReportException {
log("取数参数:"+outObject);
Object data = null;
URL url = null;
URLConnection con = null;
ObjectInputStream in = null;
ObjectOutputStream out = null;
try {
URL documentBase = this.getDocumentBase();
String protocol = documentBase.getProtocol();
String host = documentBase.getHost();
int port = documentBase.getPort(); url = new URL(protocol, host, port, requestURL + "/reportservlet");
//url = new URL("http://gsjnchenzw:8080/netbank/reportservlet"); //System.out.println(url.toString());
con = url.openConnection(); con.setUseCaches(true);
con.setDoOutput(true);
con.setDoInput(true); //输出对象到Servlet
out = new ObjectOutputStream(con.getOutputStream());
out.writeObject(outObject);
out.flush(); in = new ObjectInputStream(con.getInputStream());
data = in.readObject(); } catch (IOException e) {
e.printStackTrace();
throw new ReportException(e);
} catch (ClassNotFoundException e) {
e.printStackTrace();
throw new ReportException(e);
} finally {
try {
if (in != null)
in.close();
} catch (Exception e) {
System.out.println("StartApplet:getData:" + e);
}
try {
if (out != null)
out.close();
} catch (Exception e) {
System.out.println("StartApplet:getData:" + e);
}
}
log("返回结果:"+data); return data;
}第二个问题:
我如何将这个JAR包解压出来用呢?
throws ReportException
{ Object data;
ObjectInputStream in;
ObjectOutputStream out;
Exception exception; log("È¡Êý²ÎÊý£º" + outObject);
System.out.println("È¡Êý²ÎÊý666666666666666£º" + outObject); data = null;
URL url = null;
URLConnection con = null;
in = null;
out = null;
try
{ URL documentBase = getDocumentBase(); String protocol = documentBase.getProtocol(); String host = documentBase.getHost(); int port = documentBase.getPort(); url = new URL(protocol, host, port, requestURL + "/reportservlet"); con = url.openConnection(); con.setUseCaches(true); con.setDoOutput(true); con.setDoInput(true); out = new ObjectOutputStream(con.getOutputStream()); out.writeObject(outObject); out.flush(); System.out.println("**********************************************15");
in = new ObjectInputStream(con.getInputStream());//代码执行到这里时出EOF异常
data = in.readObject();
}
catch (IOException e) {
e.printStackTrace();
throw new ReportException(e);
} catch (ClassNotFoundException e) {
e.printStackTrace();
throw new ReportException(e);
} finally {
try {
if (in != null)
in.close();
} catch (Exception e) {
System.out.println("StartApplet:getData:" + e);
}
try {
if (out != null)
out.close();
} catch (Exception e) {
System.out.println("StartApplet:getData:" + e);
}
}
log("·µ»Ø½á¹û£º" + data);
System.out.println("·µ»Ø½á¹û6666666666£º" + data);
System.out.println("**********************************************18");
return data;
}