manuel_k
manuel_k

Reputation: 573

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?

Upvotes: 1

Views: 125

Answers (1)

Micha&#235;l L
Micha&#235;l L

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

Related Questions