we’re using Spring 3.1 for our webapp.
We currently map static resources with
<mvc:resources mapping="/static/**" location="/static/" />
and inside our skeleton template we refer to stylesheets like this:
<link rel="stylesheet" href="static/css/main.css">
What happens now is that I have no issues on loading css and images inside the main pages of the webapp (so like http://www.mysite.com ) but I get 404s inside inner pages (so like http://www.mysite.com/section1/chapter1 )
How can I solve this?
EDIT:
We’re not using JSP/JSTL. We’re using Thymeleaf.
According to the Themeleaf documentation, it would be something like this :
Or you can also use the
JSTLc:urltag if you are usingJSP: