0
votes

After running apache tomcat http://localhost:8080/ the default Tomcat page shows up, with option App manager , host manager. I am able to deploy my war file in app manager. But the link shows as http://localhost:8080/example/.

How can I load my war file on apache tomcat start up page instead of loading the tomcat default page and showing my war file index page? Also after doing so, later how can I deploy any war file as I won't be able to access the tomcat default page app manager on loading?

3

3 Answers

2
votes

I see two options:

When you deploy an application, you can give a META-INF/context.xml file. This has a declaration of the application path, docBase. Read the chapter about naming in the documentation (and the rest as well) make it "/"

Another option is the magic name ROOT (all capital) or ROOT.war. This is what Tomcat by default deploys on "/"

0
votes

You should be able to do what you want changing the context root in your web.xml but then you shouldn't be able to reach the app manager. You should change the context root of the app manager as well

0
votes

In Tomcat_HOME/conf/server.xml with these changes, I'm able to access myAPP at / and ROOT at /ROOT

<Context path="" docBase="myAPP"/>
<Context path="ROOT" docBase="ROOT"/>

Add above to the section of server.xml