aspose file tools*
The moose likes Servlets and the fly likes multiple welcome files for different uri's Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "multiple welcome files for different uri Watch "multiple welcome files for different uri New topic
Author

multiple welcome files for different uri's

Sree Jag
Ranch Hand

Joined: Oct 14, 2003
Posts: 77
Hi all,
How can we configure web.xml such that there is a <welcome file> for each URI.

ex: if we have http://localhost:8080/webapp then the welcome file should be firstWelcome.jsp
and if we have http://localhost:8080/webapp/admin then the welcome file shoulf be secondWelcome.jsp

Someone please tell me how to do this. If you can show with code, that will be great.

Thanks,
Seshu


Sree Jag<br />SCJP 1.4
Brahim Bakayoko
Ranch Hand

Joined: Aug 29, 2003
Posts: 155
You can define multiple welcome files, but only one will be used per web application.

So, you will need to create two web applications.

Alternatively, you can create a single welcome file and have it dispatch to other jsps based on the request uri.


SCJP, SCWCD, SCBCD, IBM CSD WebSphere v5, <br />A+, MCP 2000 and 2000 server, CST, and few incompleted certification tracks.<br /> <br />Ivory Coast<br /> <br />Analyze your web Request/Response @ <a href="http://webtools.servehttp.com" target="_blank" rel="nofollow">http://webtools.servehttp.com</a> down for a while...
Praful Thakare
Ranch Hand

Joined: Feb 10, 2001
Posts: 641
Try putting different index.html or index.jsp in both folders
i.e diff files for webapp folder and diff for admin folder ...hope this helps
Cheers
Praful


All desirable things in life are either illegal, banned, expensive or married to someone else !!!
Sree Jag
Ranch Hand

Joined: Oct 14, 2003
Posts: 77
Hey, thanks both the approaches work. i just wondered whether we can do it in the deployment descriptor.

thanks all,
Seshu
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: multiple welcome files for different uri's