This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
sreenath reddy
Ranch Hand
Posts: 415
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 157
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic