David Newton wrote:Depends on whether or not you want your webapp to be in the root context ("/"). If so, replace the ROOT contents with your webapp. If not, create a new directory and put it there. (Or leave it as a war file and put it under webapps and Tomcat will unarchive it for you.)
sorry, I am confused. I had thought that the root context was decided by the url-mapping in web.xml !
David Newton wrote:Maybe it'd be easier if you'd describe the problem(s). Under default circumstances what I've told you is correct.
I am sure what you described is right, I am just a little confused as to what is going on. Maybe I should start one step at a time,
1) When I place my war file in $CATALINA_HOME/webapps/, Tomcat automatically extracts it into webapps. And if I delete the war, the extracted directory also gets deleted from webapps. Is this correct?
2) I have my directory structure as
I went into myHome and I did:
jar cvf myTestApplication.war myTestApplication.
I thought this was the right way to do it, but trial and error has shown me that Tomcat will extract this as $CATALINA_HOME/webapps/myTestApplication/myTestApplication/WEB-INF/etc...
and therefore I had to go into myHome/myTestApplication and then do:
jar cvf myTestApplication.war WEB-INF
Is this the way things are meant to work?
David Newton wrote:Your directory hierarchy is unclear.
AFAIK war files should be created at the app context root, so if you have an index.html at the root level in your app it should be at the root level in the war. That said, it's been a really long time since I've created a war file by hand.