我一直在研究在 <applet>
之间使用哪个, <object>
, 或 <embed>
,但似乎都不起作用。
当我尝试通过 HTML 加载 JApplet 时,出现 RuntimeException 错误 java.lang.NoClassDefFoundError: com/sforce/ws/ConnectionException
.
当我尝试运行 number1.class 且 number1.class 位于 myfile.jar 中时,它需要库的其他 3 个 jar 文件,这就是错误所在。文件如下所示:
tomcat-->webapps-->applet-->newhtml.html
applet-->lib-->(wsc-23,enterprise,partner)
applet-->applet_class-->(number1.class,myfile.jar)
如有任何帮助,我们将不胜感激。 我还查看了大多数 stackoverflow 问题以及其他地方,但仍然没有运气!
<!DOCTYPE html>
<html>
<body>
<html type="application/x-java-applet;version=1.6"
width="512" height="512"
code="applet_class.number1.class"
src="myfile.jar,applet/lib/wsc-23.jar,
applet/lib/enterprise.jar,
applet/lib/partner.jar"/></html>
</body>
</html>
最佳答案
部署 JWS 应用程序的最佳方式。或者小程序是使用Deployment Toolkit Script .
但是看看那个元素..
<html type="application/x-java-applet;version=1.6"
width="512" height="512"
code="applet_class.number1.class"
src="myfile.jar,applet/lib/wsc-23.jar,
applet/lib/enterprise.jar,
applet/lib/partner.jar"/></html>
小程序元素的最基本形式(在 HTML 4.01 中弃用的是):
<applet
width="512" height="512"
code="applet_class.number1"
archive="myfile.jar,applet/lib/wsc-23.jar,applet/lib/enterprise.jar,applet/lib/partner.jar"/>
</applet>
- 将
html
更改为applet
。 - 删除
type
属性。 - 从 code 属性的末尾删除
.class
。 - 将
src
更改为archive
,并将所有存档放在一行中。
关于java - HTML 嵌入不适用于 Java Applet,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21393448/