简单来说:
为了在spring使用静态资源(html,css,img,js),请使用类似于以下内容的目录结构:
src/ package/ LayoutController.javaWebContent/ WEB-INF/ static/ html/ layout.html images/ image.jpg css/ test.css js/ main.js web.xml springmvc-servlet.xml@Controller public class LayoutController { @RequestMapping("/staticPage") public String getIndexPage() { return "layout.htm"; } }<!-- in spring config file --> <mvc:resources mapping="/static/**" location="/WEB-INF/static/" />layout.html
<h1>Page with image</h1><img src="/static/img/image.jpg"/>



