• Post Reply Bookmark Topic Watch Topic
  • New Topic

murach's servlets - tomcat lib directory  RSS feed

 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 37253
519
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Page 19 says "To make classes within a JAR file available to more than one web application, you can put the JAR file in Tomcat's lib directory." And page 18 says "Remember thought, that Tomcat's lib directory stores the JAR files for the class libraries that are available to all web applications running on the web server. As a result, you only use the WEB-INF\lib directory if you want to make the JAR file available to just that one application".

Is this recommended? I always thought you shouldn't put jars in Tomcat's lib directory because:
1) The app isn't self contained
2) You can't upgrade different apps on their own schedule because there are shared jar versions
 
Joel Murach
Author
Ranch Hand
Posts: 127
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jeanne,

Thanks for pointing this out. I didn't explain this concept as clearly as I would have liked.

I agree with you that it's a bad practice to put the JAR files for an application in Tomcat's lib directory. Instead, I would recommend putting the JAR files for the application in the WEB-INF\lib folder for the application precisely for the reasons you mentioned.

I have made a note of this and hope to improve this explanation in the next printing of this book.

Thanks!

Joel
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 37253
519
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh good. I'm glad you were intending to mention it as an option rather than recommend it!
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!