请求地址如下:

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

 

配置:

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

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

 

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

SpringMVC 静态资源配置 css js img等

 

 

   

相关文章:

  • 2022-12-23
  • 2021-08-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-05
  • 2021-08-04
猜你喜欢
  • 2022-12-23
  • 2021-06-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-02
  • 2022-12-23
相关资源
相似解决方案