This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSP and the fly likes jsp looking applet folder for classes 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 looking applet folder for classes" Watch "jsp looking applet folder for classes" New topic
Author

jsp looking applet folder for classes

Farooq Mahmood
Greenhorn

Joined: Feb 04, 2000
Posts: 9
Hi,

I got a problem in jsp and I desperately need help.

There is an Applet in my jsp page and applet is using a class name clientInfo.java. My beans also use this class as well. So I have put this class in Web_inf folder and with applet as well so clientInfo.java is available in 2 locations.

Most of the time my application work fines but something it give me an error in jsp, class not found error with processClient.java. But that class is available in Web_inf/lib folder. What I have seen that sometime jsp look applet folder for classes instead of web_inf /lib folder. As processClient.java is not available in applet folder so and error is generated. processClient.java has nothing to do with Applet. But when I put that class in applet folder my page work fine again. But I donot want to put that class in Applet folder as applet donot need that file.

Regards,
Farooq
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60785
    
  65

"FarooqMahmood",

We're pleased to have you here with us on the Ranch, but there are a few rules that need to be followed, and one is that proper names are required. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
Forum Bartender


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Treat your applet (client side code) and your server side code as two different applications.

The client can't read from WEB-INF and the server will only look in WEB-INF for classes.

Keep a copy in each place.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Farooq Mahmood
Greenhorn

Joined: Feb 04, 2000
Posts: 9
Thanks alot Ben Souther for your early reply.

Yes u r rite i m doing like this. I have kept copy of the class in both places. But the problem is that sometimes application look towards client side (Applet site) for perticular class instead of server side (WEB_INF/lib). As that class is not available over there so it through an exception classNotFound.

Regards,
Farooq
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

No spec compliant server I've ever known looks for java classes anywhere but under WEB-INF/classes or WEB-INF/lib (or under a shared location for all webapps).

What container are you using?
Farooq Mahmood
Greenhorn

Joined: Feb 04, 2000
Posts: 9
its JBoss 3.2.0
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: jsp looking applet folder for classes
 
Similar Threads
Unable to access servlet after publishing website
Cannot load applet
Cannot access servlet after deploying website on cpanel
General Error in JSP
Tomcat 4.0 and JSP- problem using beans