ClassNotFoundException - java applet

问题描述 投票:0回答:1

我有一个java web服务器。一个html页面提供java applet!我在不使用服务器的情况下测试了html文件,它运行正常。 html文件放置一个名为“applets”的文件夹,其中包含“.class”

html的

<applet code="applets/init.class" width="80%" height="80%> </applet>

我的问题是当我通过java服务器传递它时,我得到错误

ClasNotFoundException
applets.init.class

我已经通过浏览器直接成功下载了.class,这意味着服务器正在为.class提供服务。

当实际路径为“applets / init.class”时,为什么服务器会在“applets.init.class”中搜索.class

java applet
1个回答
0
投票

你必须这样做:

<applet code="init" codebase="applets/" width="80%" height="80%"> </applet>

还要注意缺少"以关闭高度。

© www.soinside.com 2019 - 2024. All rights reserved.