I\'m trying to make a simple Servlets + JSP project. It\'s structure looks like this:
There are two problems in your app:
In JSP, you should use ${pageContext.request.contextPath}
to append the base path for your URLs. With this, you can be sure you will use absolute path instead of relative path for your URLs. So, this:
Will be
This can also be accomplished by using
from JSTL:
Your servlet is mapping to every request made in your app. Note that this includes simple requests for resources like this CSS file. If you're not handling these requests successfully, you may get an error response or an empty response or whatever, depends on how you handle the request for CSS files in the servlet. I recommend you to change the URL pattern for your servlet to map to specific paths instead.
IndexServlet
/index