springmvc static resources

Configuration: 1. Add a configuration file to springmvc

<!-- Static resource default servlet configuration-->
<mvc:default-servlet-handler/>
<!-- Processing of static resources-->
 <mvc:resources mapping="/static/**" location="/static/" />
<!-- <mvc:resources mapping="/js/**" location="/static/js/" />
 <mvc:resources mapping="/css/**" location="/static/css/" />
 <mvc:resources mapping="/images/**" location="/static/images/" />-->
<mvc:resources mapping="/views/**" location="/WEB-INF/views/" />

2. Direct access to the bootstrap.css browser as shown above

http://localhost:8080/static/bootstrap/css/bootstrap.css

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325288684&siteId=291194637