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 Servlets and the fly likes mapping is not working 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 » Java » Servlets
Bookmark "mapping is not working" Watch "mapping is not working" New topic

mapping is not working

Hussein Baghdadi
clojure forum advocate

Joined: Nov 08, 2003
Posts: 3476

Hola folks.
I have some questions about servlets mapping (from The J2EE 1.4 tutorial).
we have a servlet called LawnServlet and its pattern is /lawn/*
we have constructed the following request :
(/catalog is the context)
trying this example at home, the index.html is not accessed.
why ?
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
ALL requests to /catalog/lawn and anything under it are sent to your servlet. Anything after it is effectively thrown away (though you can get it by reading the URL string from the request).

Ken Robinson
Ranch Hand

Joined: Dec 23, 2003
Posts: 101
If you want to request to hit your object and then cascade (or Chain) to the resource, use a Filter, not a Servlet.

With a Servlet you get full control and the resource is not hit at all.

With a Filter you still get full control, but a call to chain.doFilter() will return control to the next resource (an other Filter, Servlet or static HTML/JPG... file).
subject: mapping is not working
Similar Threads
WA #1.....word association
Q. on Servlet Mapping Specification (re-post)
Best book for the SCWCD
HF Design pattern book - Reader question
a free chapter