tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rashmi Rubdi" <>
Subject Re: How to access application in the root?
Date Thu, 03 May 2007 16:03:26 GMT
Hi Ashok,

On 5/3/07, Ashok Sahu <> wrote:
> Hi All,
>     I am migrating my J2EE application from JRun to Tomcat 5.0.28. I
> deployed successfully the 'myAppname.war' file in Tomcat. Now here is my
> problem:
> In the JRun, we were calling the jsp or servlet without giving the
> application name in the URL. Same thing I need to do in the tomcat otherwise
> it will requires lots of code changes. In the code it is written like for
> example:
> <td align=left background="/images/modulebgimage_smaller.gif">
>                 <img src="/images/moduleimage_smaller.gif">
>             </td>
>             <td vAlign=top align=right halign="right"
> background="/images/modulebgimage_smaller.gif">
>  Hence I want to access the application by using
> http://localhost:8080/servletname instead of

Here it helps to know some of the basics of Tomcat. You're looking to
deploy the application at the root Context, and the root Context is
the first slash after
the URL , for example http://localhost:8080/  <<< thats the root Context.

> http://localhost:8080/myAppname/servletname

In the above case , myAppname is the Context. The default behavior
I've seen is that when one places a someApp.war under the webapps
folder someApp automatically becomes the context.

> I am not much familiar with tomcat. Please let me know how to achieve it.

There are different configurations possible, the list of
configurations I'm writing here is just to give a hint and may not be
complete and may be partially correct but it gives the desired

1) One configuration is back up the default ROOT folder that ships
with Tomcat and then rename myAppname.war to ROOT.war , then you can
access the app at http://localhost:8080/ --- the root Context.

2) Another configuration is: In development environment , remove the
myAppname.war and delete the myAppname folder from the webapps folder
--- assuming you backed this up somewhere. Also delete ROOT.war and
ROOT folder under webapps folder.

Then simply create a ROOT.xml (Context file) under Tomcat's
/conf/Catalina/localhost/ folder , define the <Context node in this
ROOT.xml ,

for example:
<Context docBase="C:/dev/projects/myAppProject" />

With the above configuration also you can access your application at

3) Other configurations are also possible, but the above are what I
know as of now.

> Thanks in advance
> Ashok


To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message