I am copying my ROOT.war file to webapps of Tomcat 6.0 . Is there a way I can explode the file upon copying. i.e when my script copies it in the webapps .. it should explode and create ROOT directory ??
+2
A:
There are two ways that come to mind.
One is that the WAR file is a jar file, so you can use the jar command to expand it.
The other is to use the Tomcat autodeploy magic. You copy the WAR file in; Tomcat notices the change, expands the WAR, and reloads it.
William Pietri
2010-07-08 23:15:54
+1
A:
The Ant task unzip/unjar will also do the trick as the WAR file is JAR/ZIP
Miro A.
2010-07-08 23:19:21
A:
Simple, but you could always do:
cp blah.jar /usr/local/tomcat/webapps && unzip blah.jar
It assumes Unix, on windows you should be able to do something similar...
Jon
2010-07-08 23:19:33
Thanks guys !!! Actually when I copied the .war into webapps .. it automatically gets explode and it's just that it was taking up a minute to get exploded !!! Thanks again for all the answersCheers!
2010-07-09 18:41:14
A:
You should not be putting your stuff in ROOT context. Create a war named Foo.war and let "Foo" be the name of your context.
duffymo
2010-07-09 01:35:20
Why's that? When I want things at the root, which is normally the case, I put them in ROOT and it works fine.
William Pietri
2010-07-09 17:37:39
I don't think applications belong in ROOT. They should have their own context.
duffymo
2010-07-09 22:23:25
I understand that you think that. I'm asking why anybody else should think that. If you only have one app in that Tomcat, then ROOT is its own context. Works fine for me, anyhow.
William Pietri
2010-08-02 19:40:45