permaculture playing cards*
The moose likes JSP and the fly likes JSP Plugin for Applet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "JSP Plugin for Applet" Watch "JSP Plugin for Applet" New topic
Author

JSP Plugin for Applet

Varsha Pardeshi
Ranch Hand

Joined: Feb 27, 2006
Posts: 30
Hello everyone,

I am trying to use open an applet through JSP PlugIn tag, but getting the following error:

load: class Clock2.class not found.
java.lang.ClassNotFoundException: Clock2.class
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at sun.plugin.security.PluginClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadCode(Unknown Source)
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

Caused by: java.io.IOException: open HTTP connection failed.
at sun.applet.AppletClassLoader.getBytes(Unknown Source)
at sun.applet.AppletClassLoader.access$100(Unknown Source)
at sun.applet.AppletClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
... 11 more

I had set the JSP lugin tag as follows:

<jsp lugin type="applet" code="Clock2.class" codebase="/WEB-INF/classes/PackageName" jreversion="1.2" width="160" height="150" >
<jsp:fallback>
Plugin tag OBJECT or EMBED not supported by browser.
</jsp:fallback>
</jsp lugin>

Also put my class file in the path:
WEB-INF/classes/PackageName

why it is giving the Class not found error?
can anybody help me to solve this problem?

Thanks in advanced.
Regards,
Varsha Pardeshi
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60810
    
  65

I've never written an applet in my life, but I'm willing to bet that since it is the browser that needs to access the class file that you cannot put the class file under the WEB-INF folder which is protected from direct client access.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Varsha Pardeshi
Ranch Hand

Joined: Feb 27, 2006
Posts: 30
Originally posted by Bear Bibeault:
I've never written an applet in my life, but I'm willing to bet that since it is the browser that needs to access the class file that you cannot put the class file under the WEB-INF folder which is protected from direct client access.


Thanks for your reply.

But then where should I put the class file? should I keep it in the folder where all the JSP & HTML pages are there?

can u please help me out for working with JSP Plugin tag?

Thanks & regards,
Varsha Pardeshi
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60810
    
  65

Varsha, JavaRanch is a community of people from all over the world, many of who are not native English speakers. While using abbreviations like "u" instead of spelling out "you" is convenient when text messaging your friends on a cell phone or in a chat room, it presents an extra challenge to those that are already struggling with English. Additionally, such shortcuts may confound automated translation tools that patrons of the Ranch may be making use of.

I would like to ask for your help in making the content of JavaRanch a little easier to read for everybody that visits here by not using such abbreviations.

Please read this for more information.

thanks,
bear
JavaRanch Sheriff
Varsha Pardeshi
Ranch Hand

Joined: Feb 27, 2006
Posts: 30
Originally posted by Bear Bibeault:
Varsha, JavaRanch is a community of people from all over the world, many of who are not native English speakers. While using abbreviations like "u" instead of spelling out "you" is convenient when text messaging your friends on a cell phone or in a chat room, it presents an extra challenge to those that are already struggling with English. Additionally, such shortcuts may confound automated translation tools that patrons of the Ranch may be making use of.

I would like to ask for your help in making the content of JavaRanch a little easier to read for everybody that visits here by not using such abbreviations.

Please read this for more information.

thanks,
bear
JavaRanch Sheriff


I am extremely sorry for using "u" instead of "you" while asking the question.I will take care next time.

thanks,
Varsha
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41180
    
  45
The classes should go into a publicly accessible directory of the web server; customarily the one where the HTML page with the applet is located.

Also note that the package name is part of the 'code' attribute, not the 'codebase' attribute.


Ping & DNS - my free Android networking tools app
Varsha Pardeshi
Ranch Hand

Joined: Feb 27, 2006
Posts: 30
Originally posted by Ulf Dittmer:
The classes should go into a publicly accessible directory of the web server; customarily the one where the HTML page with the applet is located.

Also note that the package name is part of the 'code' attribute, not the 'codebase' attribute.


Thanks Ulf Dittmer,
Before I got your message I had put the applet & it's class file in the same folder where all the JSP & HTML pages were residing & able to run the applet. Still you have added one thing, about package name.

Thanks once again.

Regards,
Varsha Pardeshi
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSP Plugin for Applet
 
Similar Threads
java.lang.ClassNotFoundException: When including Applet in JSP
ClassNotFoundException
class not found error
Virtualhost / Webgroup not found
a simple examples cannot work.