i am calling applet jar file like this

out.println("<APPLET code = com.Sample.class " +
		"codebase = /WebContent/WEB-INF/" +
		"archive = SamplePassword_signed.jar " +
		"WIDTH = 200" +
		"HEIGHT = 350>" +
		"</APPLET>");

but it gives me a error that class path :
class com.Sample.class not found.
i have stored applet jar in web-inf folder . i am using eclipse as IDE please help me to get out put

Recommended Answers

All 5 Replies

Sharath,
When you specify "codebase = /WebContent/WEB-INF/" the browser will serach for the Class file of your Applet in the "/WebContent/WEB-INF/" in the directory in which it is running on the client machine where your servlet output is being displayed, it does not look for the class file on the server where your servlet is deployed.

For the browser to look for your applet class on the server, you need a URL of the type "http://...../" to your "codebase".

Here is what I am trying to say.

Also the class file of your applet will need to be moved out from the WEB-INF directory and into another folder from where the browser can access it via the "http://...." URL pattern

Also this should also prove somewhat useful.

Also please use code tags from the next time whenever you post any code.

And please be careful in your problem description.
You're not calling an applet from a servlet, you're including an applet tag in the output generated by a servlet.

thank u very much ... i wll try with that

Sharath,
When you specify "codebase = /WebContent/WEB-INF/" the browser will serach for the Class file of your Applet in the "/WebContent/WEB-INF/" in the directory in which it is running on the client machine where your servlet output is being displayed, it does not look for the class file on the server where your servlet is deployed.

For the browser to look for your applet class on the server, you need a URL of the type "http://...../" to your "codebase".

Here is what I am trying to say.

Also the class file of your applet will need to be moved out from the WEB-INF directory and into another folder from where the browser can access it via the "http://...." URL pattern

Also this should also prove somewhat useful.

Also please use code tags from the next time whenever you post any code.

thanks its working now

hi i have a problem i have to call applet from servlet and then from applet i have to call jsp when i click a button in applet.. please give a sample code for this and also how to send parameters from servlets to applet and applet to jsp

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.