【发布时间】:2013-03-22 14:46:16
【问题描述】:
我正在尝试通过 tomcat 中的 webapp 加载小程序。我有我的类文件,如果我在浏览器中用小程序打开 HMTL 文件,小程序就可以工作。但是如果我尝试通过 tomcat 服务器打开相同的 HMTL 文件,它会显示ClassNotFoundException。我不明白我在这里错过了什么。
我在 webapp 的根目录中有 HMTL 文件 applet.html,在学生应用程序文件夹中有类文件和 jar 文件。我的小程序标签为
<--applet
codebase="studentapp/"
code="studentapp.class"
width="450" height="450"
archive="studentapp.jar" />
当我打开applet.html 文件时,小程序会识别类文件。但是当我尝试通过tomcat服务器localhost:8080/student/applet.html打开时,却显示异常。
【问题讨论】:
-
1)
<--applet应该是<applet&"studentapp.jar" />应该是"studentapp.jar" ></applet>。我怀疑这些更改是否会解决它,但请执行它们并使用新的小程序元素编辑答案。 2) 位于localhost:8080/student/studentapp/中的内容 - 提供目录列表。 3)studentapp.jaredit the question 中的内容是jar -tvf studentapp.jar的输出 -
部署成功了吗?
标签: java tomcat web-applications applet classnotfoundexception