Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Calling an applet in a JSP page

 
udaykumar maddigatla
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm trying to embed an applet in a JSP page. I written like this.



My applet is in the package called 'Applets'. my jsp page and java classes are build in a way of normal webapplication structure.

When i try to execute the jsp page, it is giving error like below..



From the above error, my application path is http://localhost:9090/TranslationTool/

I also tried to add codebase='.'. But no use.

Please help me in this.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is "http://localhost:9090/TranslationTool/Applets/FileApplet.class " the correct path? In other words, can you download the class file if you paste that URL into the browser?

My applet is in the package called 'Applets'.

The "code" attribute must contain the fully-qualified class name, including the package. Remove the "codebase" attribute.
 
udaykumar maddigatla
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI

I removed codebase attribute and added fully Qualified class name in the code attribute. But problem remains the same.

My Class file is in this location 'TranslationTool/WEB-INF/classes/Applets/FileApplet.class'

Help me in this.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My Class file is in this location 'TranslationTool/WEB-INF/classes/Applets/FileApplet.class'

Nothing that's inside of WEB-INF can be served to the public. The class needs to be where the error message says it's looking for it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic