Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSP Plugin for Applet

 
Varsha Pardeshi
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65221
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Varsha Pardeshi
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65221
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Varsha Pardeshi
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic