[英]reference applet class in Maven webapp archetype eclipse classnotfound exception
I am trying to run an applet in HTML 5 file or JSP page in a java web dynamic project created with maven webapp archetype and imported into Eclipse. 我试图在用maven webapp原型创建并导入到Eclipse的Java Web动态项目中的HTML 5文件或JSP页面中运行applet。
folder structure: 文件夹结构:
Myproject - Deployment Descriptor: myproject - JAX-WS Web Service - Java Rsources -src/main/java com.mypackage.servlets servletsrc.java Myproject-部署描述符:myproject-JAX-WS Web服务-Java Rsources -src / main / java com.mypackage.servlets servletsrc.java
-Applets
com.myappletpackage.applets
appletcode.java
Libraries
Java Script Resources
Deployed Resources
src/
/main/
java/ ... sourcecode
/webapp
/HtmlfileCallingApplet.html
/file.html
target/
/myproject
/META-INF
/WEB-INF/
/Classes/
/com/
/mypackage
servlet.class
/myappletpackage
appletcode.class
/lib/
what is the magical code to refernce appletcode.class in my html page ? 在我的HTML页面中引用appletcode.class的神奇代码是什么? if i deploy this package , here is what i tried
如果我部署此软件包,这是我尝试过的
var attributes = {codebase:'http://localhost/Myproject/WEBINF/classes/com/MyAppletPackage/Appletcode.class',
code: 'com.MyAppletPackage.Appletcode.class',
archive: 'MyProject.war',
width: '800',
height: '600'};
var parameters = {java_arguments: '-Xmx256m'}; // customize per your needs
var version = '1.5'; // JDK version
deployJava.runApplet(attributes, parameters, version);
`
In a JSP page, i copied the class file to the path right next to the JSP page and used this in the page : 在JSP页面中,我将类文件复制到JSP页面旁边的路径中,并在页面中使用了该文件:
<jsp:plugin type="applet" code="Appletcode.class" codebase="." width="400" height="400"> <jsp:fallback> <p>Unable to load applet</p> </jsp:fallback> </jsp:plugin>
Now i am having problems referencing JAR files in the plugin , where should these files be? 现在我在插件中引用JAR文件时遇到问题,这些文件应该在哪里?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.