简体   繁体   中英

Include java applet class to my web page

How can I include my java applet class into my web page using JSP on a netbeans web application project. I don't want it as a jar. When I use a jar it works correctly. I have a package named "com.example" which is the applet named Scan.java Also have a web page named main.jsp which I added the code below.

I am using this code to include the class but

<APPLET CODE="Scan.class" WIDTH=150 HEIGHT=250>

On the browser the applet doens't open and it says "ClassNotFoundException"

How to fix that?

类“Scan”应该与您的 HTML/JSP 页面位于同一目录中,或者您可以指定相对路径(来自 JSP)以使用属性 CODEBASE 到达您的 Scan.class。

<APPLET CODE="Scan.class" CODEBASE="../classes/com/example" WIDTH=150 HEIGHT=250>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM