• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

TLD: classes must be stored in /WEB-INF/classes

 
Chandra Bhatt
Ranch Hand
Posts: 1710
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am using Tomcat 5.5.9. I find in books written like, "all the classes
must be stored in the /WEB-INF/classes directory". But while it works if
I don't place the class files in the said directory.

How does container looks at the class files stored in another location?
Where is this mapping or so?

Please help me to get that!


Thanks,
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But while it works if I don't place the class files in the said directory.

Where did you put them ? It may work if there are in the CLASSPARTH Tomcat is using. But any decent application keep class files under WEB-INF/classes.
 
Chandra Bhatt
Ranch Hand
Posts: 1710
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Satou,

Actually I was surprised with the HFSJ statement that all the classes
must be in the /WEB-INF/classes directory.

I asked that question regarding exam perspective.


Thanks,
[ June 14, 2007: Message edited by: Chandra Bhatt ]
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What the spec states is that the Web application class loader must load classes from the WEB-INF/classes directory first, and then from library JARs in the WEB-INF/lib directory.

The container is then free to do whatever it wants, as long as it respects at least the above statement. For example, you may have noticed that you can use a common directory in Tomcat where you can put common jar files. You are not limited to WEB-INF/lib either.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic