aspose file tools*
The moose likes Applets and the fly likes How to invoke applet from a JSP? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "How to invoke applet from a JSP?" Watch "How to invoke applet from a JSP?" New topic
Author

How to invoke applet from a JSP?

george vasanth
Greenhorn

Joined: Jul 07, 2004
Posts: 19
I have an applet which is in a jar file invoked from a JSP running in weblogic.

I use the following tag for invoking the applet in the JSP.

<APPLET code="BarChart.class" archive="BarChart.jar" width=500 height=500></APPLET>

But I get a ClassNotFoundException for the applet class.

Is there a specific location in which i have to put the jar file containing the applet or is there a change in the tag used to invoke the applet?

Any pointers or suggestions would be of great help.

Thanks in advance.
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24184
    
  34

The class files should be in the same place as the JSP, not in WEB-INF/classes or WEB-INF/lib. Those directories are only for classes that run on the server, whereas your applet classes are, as far as the webapp is concerned, just dumb data to be shipped to the browser on request. So the class files have to be in a public document directory, such as where the JSP is, so the browser can ask for them and they can be served by the web server.


[Jess in Action][AskingGoodQuestions]
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41867
    
  63
George-

Before you started this thread, I answered your question in a private message. Next time you have a question, consider more carefully where and how you post it, or people will get the idea that you're taking liberties with their time by duplicating effort.
[ November 03, 2005: Message edited by: Ulf Dittmer ]

Ping & DNS - my free Android networking tools app
george vasanth
Greenhorn

Joined: Jul 07, 2004
Posts: 19
Thanks Ernest and Ulf for your suggestions. I was able to solve the problem with your help.Apologize for duplicating the post. Would be careful henceforth.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to invoke applet from a JSP?