• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Applet in web application (WAR)

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi friends

I have a web application with a lot of classes with JSPs and servlets in front.
Also I have an applet that sometimes call by a JSP.
This applet also is in my web structure.
Certainly this web application will depoly in form of WAR and not JAR file.
My problem is how can I load applet in JSP?
some points:
-Applet is in WEB-INF.
-I can not make a seperate jar for this applet because it use classes in my web application (Import com.myApplication...).


Thanks
[ December 31, 2005: Message edited by: Reza MRB ]
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Reza-

Welcome to JavaRanch.

A bit of business up front: We have a policy on screen names here, which we take serious. The name should consist of a first name and a last name, with no abbreviations. You can adjust it right here. Thanks for your attention to this matter.

As to your question, I assume it is about where to put the class files, and how to access them in the applet. Usually, they are kept in the same directory as the HTML/JSP page that contains the applet, but they don't have to be. The "archive" attribute of the applet tag can be used to specify where jar files needed by the applet are kept. You can find details here.

However, the classes and jar files can NOT be in the WEB-INF directory. That's because the browser JVM accesses the class and jar files via HTTP, and the servlet engine will not server any files inside WEB-INF via HTTP. That's a security restriction, and a good one at that. You will need to package any classes the applet needs as jar files outside of WEB-INF, and use the archive attribute to let the applet know where they are.
[ December 31, 2005: Message edited by: Ulf Dittmer ]
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic