I am curious to know about how to manage my local development of a webapp and the Tomcat server I'm deploying to.
I'm using Netbeans 4.1 where I include the servlet api so those classes are available to me in my project. However, I don't think I should have to include it in my app's lib directory seeing as how Tomcat will already be running that for me. Do I just need to make sure that my ant deploy task omits that jar from the build or do I need to have the api in both the Tomcat lib and the webapp's lib?
Well, not that this is really an IDE question, but whatever... probably more an ANT topic, but definitiely servlets... when I'm in the project whether working in notepad or whatever, I need to tell ANT what to do. It needs to know what libraries to use when compiling. However, my local enviornrment maybe windows with a local version of Tomcat, but I'm deploying to a Linux box where I have no visibility outside of dropping in the war file to a folder. I could just set the classpath to the local tomcat instance's servlet.jar but that doesn't seem right. Plus, how will that affect my deployment? Do I need to configure some env variable to abstract this?
I need my project to compile so I can build the WAR, but I don't want to include a servlet.jar in my lib folder of my webapp. How do I organize my project make sure I avoid conflicts? And will Tomcat by default override whatever servlet.jar I've specified with its own?
Originally posted by Bob Robertson: I need my project to compile so I can build the WAR, but I don't want to include a servlet.jar in my lib folder of my webapp
Correct. If you are building on a different system than Tomcat is installed upon, you'll need a local copy of the APIs to build against. Make sure that the file is in the classpath of the compile, but not somewhere where it will become part of the generated war file.
If the compile occurs on the same system, just add Tomcat's copy of the API to your compilation classpath.
Originally posted by Bob Robertson: And will Tomcat by default override whatever servlet.jar I've specified with its own?
Tomcat will have a copy of the API on its own classpath -- you don't need to worry about it. [ December 29, 2005: Message edited by: Bear Bibeault ]