This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes BEA/Weblogic and the fly likes Question about web.xml file.... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "Question about web.xml file...." Watch "Question about web.xml file...." New topic

Question about web.xml file....

Ranch Hand

Joined: Jul 06, 2001
Posts: 257
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...
Ranch Hand

Joined: Jul 06, 2001
Posts: 257
THANKS FOR NOTHING! I figured it out on my own.
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.
[ January 23, 2002: Message edited by: SAFROLE YUTANI ]
subject: Question about web.xml file....
Similar Threads
Keeping track of the requests in a servlet
custom tag help
Openeing new window from Servlet
Why is my Filter called for every image, included jsp and the main jsp?
Servlet Filters with struts