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

multiple welcome files.

 
Milan Jagatiya
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
i have index.jsp in my root directory. to set welcome file i put below mapping in web.xml

its working properly..."http://localhost:8080/usermgmt/"

but now i have a another folder "admin" having index.jsp file. i want to display admin/index.jsp file as a welcome page for admin when i call "http://localhost:8080/usermgmt/admin/"
for that i wrote below mapping...but its not working...



please correct me.
thanks in advance..

milan.
[ January 23, 2007: Message edited by: Milan Jagatiya ]
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Looks like a Servlet/JSP question, so I am going to move this to a more appropriate forum.

Mark
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From the servlet spec:


Note: there are no forward slashes in front of the file names.


I'm guessing that your entry was never working and that you were seeing index.jsp because your container had that listed as one of the default values.
For instances, here is the welcome-file entry in the default web.xml found in Tomcat's conf directory:

[ January 24, 2007: Message edited by: Ben Souther ]
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It should be


no need to put /.as index.jsp would be looked in the directory pointed by your request url.you can have more than one <welcome-file> tag.
 
Milan Jagatiya
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
thanks for your replies, but my problem not matching your answers. what i want is below...

1) i want to set login.jsp as a welcome file for "http://localhost/myapp/".
path for login.jsp is myapp (root directory).
this works by..


2) and index.jsp as a welcomefile for "http://localhost/myapp/admin".
path for index.jsp is myapp/admin/

what should i do for (2) problem???

milan.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you cannot use welcome files for this. You'll have to use servlets or filters and redirect to the proper file according to the requested path.
 
Milan Jagatiya
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks Satou,
i was confuseed whether tomcat allows this facility of not....

thanks again.
milan.
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Milan Jagatiya:
hi,
thanks for your replies, but my problem not matching your answers. what i want is below...

1) i want to set login.jsp as a welcome file for "http://localhost/myapp/".
path for login.jsp is myapp (root directory).
this works by..


2) and index.jsp as a welcomefile for "http://localhost/myapp/admin".
path for index.jsp is myapp/admin/

what should i do for (2) problem???

milan.


Do the following



just change in the web.xml according to what I have posted and then you would certainly get your required behaviour.
 
Milan Jagatiya
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks rahul,

actually i have tried this but i was forget to deploy my updated war in tomcat. even i was confident about that....but because of old deployment i was confused.....

milan.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic