SpringMVC static resource allocation css js img, etc.

Request following address:

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

 

Configuration:

spring-mvc.xml (not necessarily placed under static directory, the location of the custom, according to find location)

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

 

Under the asset into a location attribute specified directory, in this case static directory

 

 

   

Guess you like

Origin www.cnblogs.com/hfultrastrong/p/12195584.html
Recommended