• 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
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Question about web.xml file....

 
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am implementing a Front Controller pattern for a web application at my company. All requests submitted to jsp pages must be mapped to a controlling servlet named "Controller". In other words, I would like to map *.jsp to Controller in order for the servlet to handle the request and determine which action to take. I'm not sure how to route all jsp requests to the servlet. Should I use the <filter-mapping> element in web.xml? If so, can someone give an example of how to set up the filter? thanks guys...
SAF
 
SAFROLE YUTANI
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
THANKS FOR NOTHING! I figured it out on my own.
Answer:
To map requests to a servlet using a pattern, use the following definition in web.xml:

The definition above indicates to the web container that any request for a jsp page made from the context root "/app1/" will be redirected to the CountServlet.
SAF
[ January 23, 2002: Message edited by: SAFROLE YUTANI ]
 
I can't beleive you just said that. Now I need to calm down with this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic