Jsp页面上的JUpload问题

时间:2011-02-01 12:40:05

标签: java jsp applet jupload

我得到了:

load: class wjhk.jupload2/JUploadApplet.class not found.
java.lang.ClassNotFoundException: wjhk.jupload2.JUploadApplet.class
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: open HTTP connection failed:http://test1/EAMAPP84/data/docuploads/ROADS/NoamTest/wjhk/jupload2/JUploadApplet/class.class
at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
... 9 more
Exception: java.lang.ClassNotFoundException: wjhk.jupload2.JUploadApplet.class

on java consule。

小程序被调用:

<applet
code="wjhk.jupload2/JUploadApplet.class"
codebase="\EAMAPP84\data\docuploads\ROADS\NoamTest"
archive="JUpload.jar"
width="650"
height="400">
<param name="actionURL"
value="\\test1\EAMAPP84\data\docuploads\ROADS\NoamTest">
</applet>
当jar位于给定目录中时

。 奇怪的是,当我使用它创建一个简单的html文件时,它可以工作,但是当我在jsp页面中使用它时,我会收到此错误。

2 个答案:

答案 0 :(得分:0)

code属性应该指向类的fully qualified name(与在普通Java类的import语句中使用的相同)。

code="wjhk.jupload2.JUploadApplet"

顺便提一下,例外的是:

java.lang.ClassNotFoundException: wjhk.jupload2.JUploadApplet.class

.class部分根本不属于那里)

也在这里:

java.io.IOException: open HTTP connection failed:http://test1/EAMAPP84
/data/docuploads/ROADS/NoamTest/wjhk/jupload2/JUploadApplet/class.class

(注意明显错误的/class.class部分)

答案 1 :(得分:0)

code="wjhk.jupload2/JUploadApplet.class"

应该是......

code="wjhk.jupload2.JUploadApplet"