Evgeny Makarov
Evgeny Makarov

Reputation: 1448

change default application in tomcat 6

I got an maven project that produces a war package. When I copy war to tomcat 6 webapps directory and start tomcat, I see my application is being deployed and running but when I try to go localhost I got default tomcat page displayed. From googling around I got that I have to define context.xml file in my META-INF folder but I have no idea how can I define it. Can someone give me an example?

Thanks

Upvotes: 0

Views: 1939

Answers (3)

Ayub Malik
Ayub Malik

Reputation: 2578

Create a file called context.xml in your webapp/META-INF folder. With this content

<Context path="/yourAppName" />

Upvotes: -1

Evgeniy Dorofeev
Evgeniy Dorofeev

Reputation: 136162

The simplest way is to rename your webapp folder to ROOT

Upvotes: 1

M Sach
M Sach

Reputation: 34424

i think what you want is when type in browser http://localhost:8080 you are directed towards your application welcome page

It is quite easy to override that page. Inside $TOMCAT_HOME/conf/web.xml there is a section called and it looks like this:

<welcome-file-list>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.jsp</welcome-file>
</welcome-file-list>

The default servlet attempts to load the index.* files in the order listed. You may easily override the index.jsp file by creating an index.html file at $TOMCAT_HOME/webapps/ROOT. It's somewhat common for that file to contain a new static home page or a redirect to a servlet's main page. A redirect would look like:

 <html>

<head>
<meta http-equiv="refresh" content="0;URL=http://mydomain.com/some/path/to/servlet/homepage/">
</head>

<body>
</body>

</html>

If you simply want to access you application with not the intention i explained above

http:/localhost:PortNumber//WelcomePage.html

Upvotes: 1

Related Questions