I'm setting up a simple servlet to act as a forwarder. Basically so that you can hit the page with this http://localhost:8080/WebProjectName/ServletName/foo/bar
instead of like this http://localhost:8080/WebProjectName/Main.jsp?par1=foo&par2=bar
However, it seems to break in a way that I don't even know where to begin looking. It forwards to the page fine when I go to this http://localhost:8080/WebProjectName/ServletName
, but when I add anything on the end, it doesn't load any styling or images. Just the text content of the pages.
Anyways, here's my simple servlet
protected void doGet( HttpServletRequest request, HttpServletResponse response ) throws ServletException, IOException {
request.getRequestDispatcher( "/main.jsp" ).include( request, response ) ;
}
And here is the web xml chunk
<servlet>
<description></description>
<display-name>Main</display-name>
<servlet-name>Main</servlet-name>
<servlet-class>package.thing.Main</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Main</servlet-name>
<url-pattern>/ServletName/*</url-pattern>
</servlet-mapping>
What's happening when I even just add a slash, that would cause it to only load the text of main.jsp, and not the styling or any images?
This works: http://localhost:8080/WebProjectName/ServletName
This breaks: http://localhost:8080/WebProjectName/ServletName/
This also breaks: http://localhost:8080/WebProjectName/ServletName/why