File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes settting my webapplication index page as tomcats index page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "settting my webapplication index page as tomcats index page" Watch "settting my webapplication index page as tomcats index page" New topic
Author

settting my webapplication index page as tomcats index page

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 ??
asirob civokviz
Greenhorn

Joined: Jun 12, 2004
Posts: 24
$CATALINA_HOME/conf/web.xml

go to the end of file!

You will see welcome-file-list section...

pick what to add and what to delete....
In your case just add new <welcome-file>login.jsp</welcome-file>

enjoy...
somkiat puisungnoen
Ranch Hand

Joined: Jul 04, 2003
Posts: 1312
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




You must change <context-root> config in web.xml in each application.


OR

IF your server is tomcat 5.XXX ,So, it will generate some xml in /conf/Catalina/<host-name>/yourapp.xml

Default


Change to



SCJA,SCJP,SCWCD,SCBCD,SCEA I
Java Developer, Thailand
sreenath reddy
Ranch Hand

Joined: Sep 21, 2003
Posts: 415
Hi

The way u told is right but there is one problem coming up .i am having my web apllication in webapps and there will be no entry in catalina/localhost folder for that application.If i create one in that folder ..whats happening is that application is getting loaded twice ....as a result of that my init servlet is getting executed twice leading to some corruption of data in my application


How shall i go about that ?? Any idea on this would be apprecable
somkiat puisungnoen
Ranch Hand

Joined: Jul 04, 2003
Posts: 1312
Step in Create My web application in Tomcat

1. Create WAR file for deploy : mywebapp.war
2. Deploy to Tomcat : Use Tomcat Manager for Deploy war file
3. After deployed completed, Tomcat MUST be create /conf/Catalina/<hostname>/mywebapp.xml
4. Change config in mywebapp.xml follow me .



Change to



and may be conflict with ROOT.xml so change patn in ROOT.xml in another name ..

[ September 13, 2004: Message edited by: Somkiat Puisungnoen ]
[ September 13, 2004: Message edited by: Somkiat Puisungnoen ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: settting my webapplication index page as tomcats index page
 
Similar Threads
url blues
Struts
How can i change the url of struts?
Giving alias for http://localhots:8080/webapp
multiple URL mapping for one web app