【问题标题】:applet not loading in tomcat小程序没有加载到tomcat中
【发布时间】: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) &lt;--applet 应该是 &lt;applet & "studentapp.jar" /&gt; 应该是 "studentapp.jar" &gt;&lt;/applet&gt;。我怀疑这些更改是否会解决它,但请执行它们并使用新的小程序元素编辑答案。 2) 位于localhost:8080/student/studentapp/ 中的内容 - 提供目录列表。 3) studentapp.jar edit the question 中的内容是jar -tvf studentapp.jar 的输出
  • 部署成功了吗?

标签: java tomcat web-applications applet classnotfoundexception


【解决方案1】:

嗯……

localhost:8080/student/applet.html

我想你应该把你的 applet 学生文件夹放到 Tomcat webapps 文件夹中... :S 无论如何,在问这种问题之前请仔细阅读Tomcat deployment specifications


如果有用,请报告

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-10-18
    • 2010-11-06
    • 1970-01-01
    • 1970-01-01
    • 2015-06-25
    • 1970-01-01
    • 2014-07-17
    • 2011-01-23
    相关资源
    最近更新 更多