Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

settting my webapplication index page as tomcats index page

 
sreenath reddy
Ranch Hand
Posts: 415
  • 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 ??
 
asirob civokviz
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
$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
Posts: 1312
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

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