Home arrow static arrow Java Programming [Archive] - APPLET & TOMCAT
Warning: Creating default object from empty value in /www/htdocs/w008deb8/wiki/components/com_staticxt/staticxt.php on line 51
Java Programming [Archive] - APPLET & TOMCAT
This topic has 5 replies on 1 page.

Posts:281
Registered: 4/10/03
APPLET & TOMCAT  
Aug 2, 2004 6:24 PM



 
Hi guys!!!

I deploy a jsp that load an applet. But I get some problems - the main problem consist of I cannot access the WEB-INF directory (where my lib is located). What I need to develop an applet that can use the library placed inside the WEB-INF directory?!?!

Or I realy need put all classes that the applet use outside WEB-INF!!!!??

Thanks.

Giscard
 

Posts:3,183
Registered: 10.09.03
Re: APPLET & TOMCAT  
Aug 3, 2004 3:32 AM (reply 1 of 5)



 
an applet executes on the client, not on the server. Anyway, an applet is not supposed to access the filesystem, that would be a huge security leak. Think of the following:

1) an applet executes and recursively deletes all files on the system
2) an applet executes, loads your addressbook and saves all addresses in a database to be spammed later.
 

Posts:3,183
Registered: 10.09.03
Re: APPLET & TOMCAT  
Aug 3, 2004 3:33 AM (reply 2 of 5)



 
errrrrr... scrap that last remark. You are not trying to access the filesystem :s
 

Posts:281
Registered: 4/10/03
Re: APPLET & TOMCAT  
Aug 3, 2004 3:50 AM (reply 3 of 5)



 
Don�t worry about this!!!!! : )

I just guess strager build a file structure directory (WEB-INF) for store my class files and even build another .class "container" to store my classes that the applet will access!!!!

I am sure that exist another thing to do!!!! I just don't know how!!!! : )

Giscard
 

Posts:441
Registered: 2/25/04
Re: APPLET & TOMCAT  
Aug 3, 2004 5:02 AM (reply 4 of 5)



 
Normally browsers cannot access the code that implements the server in the web-inf directory, so your applet can't load. Applets are better served by packing their code into a jar archive, which needs to be placed somewhere the browser can download it.

Pete
 

Posts:14,142
Registered: 99-04-02
Re: APPLET & TOMCAT  
Aug 3, 2004 6:59 AM (reply 5 of 5)



 
The WEB-INF directory is a private directory and is not (normally) accessible from the browser. No files that the browser will have to use (HTML files, images, JSP files, ect) need to not be put in that directory. That directory is only for server-side content (servlet classes, other classes/libraries for tags or whatever else runs on the server).

Applets run in the browser. Applets, as it happens, have nothing whatsoever to do with JSP/servlets. Applets have been around a lot longer then JSP/servlets. Applets are class files that are loaded by the browser and run in the browser, no differently then the browser loading HTML files, images, Flash files or whatever. So put the applet's classes and other things outside the WEB-INF folder like you would any other web content.
 
This topic has 5 replies on 1 page.