I'm building a Java web application with HTTP Servlets and I want to route all of the document requests to one Servlet class.
By document request, I mean that I don't want to have requests for images like favicon.ico going to my servlet, which is the case if I just use this mapping.
<servlet-mapping>
<servlet-name>myservlet</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
What I'm doing is working pretty much like Symfony (the php framework) Controller layer. So I don't know what is the requested URI going to look like, I only know that it's going to follow this pattern: /controller[/method]
. So I can't just use /action/* mapping for example.
I'm not looking for any Java MVC framework here since this is a school assignment, so I have to program it myself.