Deb Dey
Deb Dey

Reputation: 325

When does Tomcat unpack a war file to a ROOT folder?

I'm trying to deploy a war on Tomcat 7.0, and in the server.xml file, I've set unpackWARs = true and autoDeploy = true.

Since I want this war file to be the default web application, I have deleted the ROOT folder inside ...Tomcat7.0/webapps. Then on, when I try to start the Tomcat service, I see a behavior that I have yet failed to identify a pattern in:

It seems to be completely erratic and random, but I am sure there is method behind this apparent madness. As a rule, I am not sure if there is anything that dictates the creation of a ROOT folder. I have tried to edit the server.xml file and add context to my web application in it, but it doesn't seem to make a difference.

What am I missing? Thanks in advance!

Upvotes: 5

Views: 14178

Answers (1)

Ove Sundberg
Ove Sundberg

Reputation: 333

Name your war file ROOT.war. It will unpack to ../webapps/ROOT and map to / context

Upvotes: 7

Related Questions