I\'m trying to put CSS, JS and IMGs on my JSP, but doesn\'t work, it\'s strange because I use c:url
and \"jstl/core\"
I\'m use JSP, jstl and servlet, no
The url pattern "/"
has a special meaning to the web server. It's used for default servlet mapping which is capable of serving the static content. The static content is JS, CSS, images, html resources. Directing these files to your servlet is wrong, because it's not capable to serve the static content.
Change the servlet mapping to something @WebServlet(urlPatterns="/incidente")
and use url localhost:8080/PainelProduct/incidente
to forward to jsp page.
Check this question to learn more about servlets and servlet mapping Mapping a specific servlet to be the default servlet in Tomcat.
I have encountered the same problem and have not resolved it for a long time. Then I realized that it was a problem from the path of the images.
Wrong path is like that;
src>main>resources>images
The order of files(path) should definitely be as follows.
src>main>webapp>resources>images
and you should to call the function like that;
<img src="<c:url value="/resources/img/logo.png"/>" alt=""/>
You are not escaping the " when using inside the href value, use ' instead