Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tomcat URL Mappings ... ? 1

Status
Not open for further replies.

jonalport

Programmer
Sep 22, 2004
1
ZA
I have a relatively simple question regarding tomcat and URL Mappings...

I have a webapp that I have developed in a folder called 'myFolder' for
example. JBuilder then packs my webapp into myFolder.war when it's
built.
When I deploy myFolder.war to tomcat, it is unpacked into the folder
'myFolder' in the webapps directory as expected.
So I can now browse to which works
fine.
But I wanted to be able to get to my login.jsp page by just pointing
to
so I placed a redirecting page in the root webapp
folder
which redirected to the file login.jsp in the folder myFolder, but
then of
course I still have the 'myFolder' displayed in the url.

So I guess I have two questions:

1. how do I edit the web.xml (?) so that goes
directly to
my webapp in 'myFolder' without displaying 'myFolder' in the URL ?

2. how do i set it up so that login.jsp is the initial page displayed
?

I'm running Tomcat 5.0.19 standalone (eg. no IIS || apache etc) on
win2000
server
 
Under your TOMCAT_HOME/conf/server.xml, add a Context mapping thus :
Code:
<Host name="localhost" debug="0" appBase="webapps"
         unpackWARs="true" autoDeploy="true"
         xmlValidation="false" xmlNamespaceAware="false">

<Context path="" docBase="myFolder" debug="0"
                   reloadable="true" crossContext="true"/>

</Host>

--------------------------------------------------
Free Database Connection Pooling Software
 
Alternatively, delete your ROOT directory in the tomcat's webapp folder, and named you war file as ROOT.war. Tomcat will then deploy your applicate as root.
 
You are right sedj. Sorry to not mention that my approach doesn't allows cross context between applications.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top