Reputation: 573
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?
Upvotes: 1
Views: 125
Reputation: 459
The class "Scan" should be on the same directory than your HTML/JSP page, or you could specify the relative path (from the JSP) to reach your Scan.class with the attribute CODEBASE.
<APPLET CODE="Scan.class" CODEBASE="../classes/com/example" WIDTH=150 HEIGHT=250>
Upvotes: 1