This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan 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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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).
I agree. Here's the link:
subject: mapping is not working
Similar Threads
a free chapter
Best book for the SCWCD
Q. on Servlet Mapping Specification (re-post)
WA #1.....word association
HF Design pattern book - Reader question