我們使用Spring 3.1作爲我們的web應用程序。Spring MVC 3和處理靜態內容 - 模板中的引用
我們目前與
<mvc:resources mapping="/static/**" location="/static/" />
映射靜態資源和我們的骨骼template裏面我們提到樣式表是這樣的:
<link rel="stylesheet" href="static/css/main.css">
現在會發生什麼事是,我有加載CSS和圖像沒有任何問題在webapp的主要頁面(如http://www.mysite.com)中,但我在內部頁面中獲得404(類似於http://www.mysite.com/section1/chapter1)
我該如何解決這個問題?
編輯:
我們不使用JSP/JSTL。我們正在使用Thymeleaf。
我更新我的Thymeleaf響應。 –