I'm trying to follow the pattern at Design Patterns web based applications. It all works fine part from when it comes to maping "root" URLs.
I'd like to put all requests through the "Front Controller" so I've put
<servlet-mapping>
<servlet-name>ControllerServlet</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
in the web.xml
. Stepping through with Netbeans shows the request coming in, and the Action working OK, but then the line
request.getRequestDispatcher("/WEB-INF/" + view + ".jsp").forward(request, response);
ALSO gets caught by the controller, it goes to the Action again and it all fails.
I can make it work by not going from the URL root e.g.
<servlet-mapping>
<servlet-name>ControllerServlet</servlet-name>
<url-pattern>/pages/*</url-pattern>
</servlet-mapping>
But that isn't what I want. Is there any way to make it work with "root" URLs?