This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Servlets and the fly likes 'lib' folder contents Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark " Watch " New topic
Author

'lib' folder contents

Aditya Karnad
Greenhorn

Joined: Feb 20, 2007
Posts: 10

I have many servlet applications on my Eclipse workspace... all of these apps have a lib folder... all of these lib folders contain those common jars that are used in servlet apps i.e. servlet-api.jar, jsp-api.jar, etc.

I was wondering if this was good practice. Because, these jars are already present in the <Tomcat Home>\lib location. How bout just referencing these from the server's original location? I'm guessing it would NOT cause portability issues, cos all tomcat folder structures have the lib in the same location...

Cheers!
sudhir nim
Ranch Hand

Joined: Aug 29, 2007
Posts: 212

Yes, you don't need to put servlet-api and jsp-api along with other jars that are provided by the implementation in lib folder.
You can directly refer them in your build path, or create a user library with required jars and add the library to projects build path
You can create user library from windows > preferences > java > build path > user libraries


[Servlet tutorial] [Servlet 3.0 Cook Book]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60732
    
  65

In fact, copying the servlet and JSP jars into WEB-INF/lib is a really really bad idea and it can cause all sorts of problems. Never do this!


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Aditya Karnad
Greenhorn

Joined: Feb 20, 2007
Posts: 10

Thanks Sudhir... Thanks Bear...
 
jQuery in Action, 2nd edition
 
subject: 'lib' folder contents
 
Similar Threads
javax.servlet.* - cannot be resolved
Eclipse + Tomcat + JSP's on the Mac
package javax.servlet.jsp.tagext does not exist
IllegalAccessError in JstlCoreTLV
Tomcat server restarted automatically