lundi 10 octobre 2016

Java spring web app can not find resources

Could not resolve this issue by reading other stackoverflow posts and reading other articles. To be clear I want to map my css/js/... resources so I could access them in my .jsp.

Here is what I have:

dispatcher-servlet.xml

<mvc:resources mapping="/css/**" location="/WEB-INF/resources/css/"/>
<mvc:resources mapping="/js/**" location="/WEB-INF/resources/js/"/>

jsp file (it is included as header in index.jsp)

<%@ taglib uri="http://ift.tt/QfKAz6" prefix="c"%> <link type="text/css" href="css/boostrap.css" rel="stylesheet"/> <script type="text/javascript" src="js/boostrap.js"></script>

what browser says (device-fingerprinting is app name ofc) enter image description here

Tomcat 8.5 log says

INFO: Mapped URL path [/css/**] onto handler 'org.springframework.web.servlet.resource.ResourceHttpRequestHandler#0'

So you know I have tried using c:url tag but that didn't help so currently I am not using it.




Aucun commentaire:

Enregistrer un commentaire