SpringMVC 静态资源配置 css js img等

请求地址如下:

http://localhost:2323/static/js/main.js

 

配置:

spring-mvc.xml(并非必须放入static目录下,该位置自定义,根据location查找)

<mvc:resources mapping="/static/**" location="static/"/>

 

将资源放入location属性指定的目录下,此处为static目录

 

 

   
posted @ 2020-01-15 10:56  GordonDicaprio  阅读(475)  评论(0编辑  收藏  举报