我正在尝试通过 tomcat 中的 webapp 加载一个小程序。我有我的类文件,如果我在浏览器中用小程序打开 HMTL 文件,小程序就可以工作。但是,如果我尝试通过 tomcat 服务器打开相同的 HMTL 文件,它会显示 ClassNotFoundException
。我不明白我在这里错过了什么。
我在 web 应用程序的根目录中有 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
打开它时,它显示异常。
最佳答案
嗯...
localhost:8080/student/applet.html
我想你应该把你的 applet student 文件夹放到 Tomcat webapps 文件夹中...:S 总之,请仔细阅读Tomcat deployment specifications在问这类问题之前
报告是否有用
关于java - 小程序未加载到 tomcat 中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15744935/