views:

112

answers:

0

I am trying to get a servlet to respond to every request with a url-pattern of "/test/*". so this controller should respond to :

myApp/test/
myApp/test/whatever
myApp/somehting?other=stuff

using the following mapping:

<servlet-mapping>
    <servlet-name>test</servlet-name>
    <url-pattern>/test/</url-pattern>
</servlet-mapping>

The controller is called fine but the forwarding to the view:

RequestDispatcher view = request.getRequestDispatcher("test.jsp");
view.forward(request,response);

is generating an error:

Exceeded maximum depth for nested request dispatches

I guess the url matching happens on forwards to views too? as in it is going through the same routing process as incoming requests - or partly?

what is the correct way to use * in the url-pattern without causing this?