jQuery in Action, 2nd edition*
The moose likes Struts and the fly likes Giving alias for http://localhots:8080/webapp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Giving alias for http://localhots:8080/webapp" Watch "Giving alias for http://localhots:8080/webapp" New topic
Author

Giving alias for http://localhots:8080/webapp

sreenath reddy
Ranch Hand

Joined: Sep 21, 2003
Posts: 415
Hi

I need answer for this req...dont know whether it exists r not

now i have a webapplication in tomcat

and as of now i am accessing that by using http://localhost:8080/webappname

and i have a welcome file for that webapplication as login.jsp

but i need to redirect to my application just by using
http://localhost:8080/ .as soon as the user enters this i want to redirect him to login.jsp

How can i do this ??
Sheldon Fernandes
Ranch Hand

Joined: Aug 18, 2004
Posts: 157
The default Web site for tomcat is $CATALINA_HOME/webapps/ROOT/.

Approach 1: (Redirect to your web site from the default web site)
In the file $CATALINA_HOME/conf/server.xml, you will find the configuration for the root context. This is how the entry looks, after installing tomcat.

<!-- Tomcat Root Context -->
<!--
<Context path="" docBase="ROOT" debug="0"/>
-->

Uncomment the entry, and place an index.html file in $CATALINA_HOME/webapps/ROOT which loads the desired page from your web application.

OR

Approach 2: (Change the default web site)
Add a root context (site) to the contexts near the end of the file $CATALINA_HOME/conf/server.xml:

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

You can comment out the old root context (which will no longer be accessible anyway).

NOTE: You will need to update your welcome file list in server.xml to include login.jsp OR rename it to index.jsp.

Hope this helps. (I checked this out for tomcat 4, not sure about other versions)
Sheldon
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Giving alias for http://localhots:8080/webapp