• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

multiple welcome files for different uri's

 
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 645
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Sree Jag
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey, thanks both the approaches work. i just wondered whether we can do it in the deployment descriptor.

thanks all,
Seshu
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic