You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Ashok Sahu <as...@gmail.com> on 2007/05/03 08:38:52 UTC

How to access application in the root?

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
http://localhost:8080/myAppname/servletname
I am not much familiar with tomcat. Please let me know how to achieve it.

Thanks in advance
Ashok

Re: How to access application in the root?

Posted by Rashmi Rubdi <ra...@gmail.com>.
Hi Ashok,

On 5/3/07, Ashok Sahu <as...@gmail.com> 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
behavior.

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
http://localhost:8080/

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

>
> Thanks in advance
> Ashok
>

-Regards
Rashmi

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org