Win a copy of Spark in Action this week in the Open Source Projects forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

jsp looking applet folder for classes

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Marshal
Posts: 67413
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"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
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Farooq Mahmood
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
its JBoss 3.2.0
 
Life just hasn't been the same since the volcano erupted and now the air is full of tiny ads.
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic