• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Location of 3rd Part JARs

 
Reema Patel
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,
I know that the ideal place to put third part JAR files in a web app is the WEB-INF/lib dir. But, what about If I put the same JAR also in the WEB-INf/classes directly, which one will be picked up? Also, Is WEB-INF/classes the right place to put JARs?

Thanks,
Reema
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No jar files will be recognized that are in WEB-INF/classes. That directory is for .class files only, not .jar files.
 
carina caoor
Ranch Hand
Posts: 300
Eclipse IDE Oracle Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you unzip the jar and place the class files then its fine but,there are older versions of tomcat that do not include WEB-INF/lib/*.jar in there classpath so we need to manually unzip the jar and place the .class files in the WEB-INF/classes folder, jar's are to be kept in WEB-INF/lib and .class files are to be kept in WEB-INF/classes only..
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by ruquia tabassum:
there are older versions of tomcat that do not include WEB-INF/lib/*.jar in there classpath

I'm not sure what you're talking about here. The servlet spec has always said that jar files in WEB-INF/lib get included automatically, ever since the concept of web applications got introduced in the Servlet API 2.2. So all Tomcat versions from 3.x onward (which was actually the first Tomcat release) have always done it this way.
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unjarring a JAR into the classes directory is a lot of extra work without any added benefit.

Not to mention there's a good chance your build process's early steps will wipe the classes directory's contents, so your unjarred files would likely get removed on the next build.
 
Reema Patel
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks All!
[ December 18, 2007: Message edited by: Reema Patel ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic