"; then add the configuration ""."> What should I do if springmvc does not load css?-CSS Tutorial-php.cn

What should I do if springmvc does not load css?

藏色散人
Release: 2020-12-22 09:44:17
Original
2275 people have browsed it

The solution to springmvc not loading css: first add the default configuration to the SpringMVC configuration as ""; then add the configuration " " ;" that's it. ">

What should I do if springmvc does not load css?

The operating environment of this tutorial: Windows7 system, css3&&Spring5.x version, this method is suitable for all brands of computers .

Recommended: "css Video Tutorial"

SpringMVC cannot load js, css and other static resource files, and an exception cannot be found when running. How to solve this?

Since SpringMVC supports more elegant Rest-style URLs, and url-patten is configured to support all patterns, static resources (css, js, html, etc.) will also be matched. Once the matching fails The console will throw a URI matching exception.

In this case, you need to add the default configuration in the SpringMVC configuration

Copy after login

After adding the above configuration, the original RequestMapping will be abnormal again. At this time, you need to add the following configuration

Copy after login

Note that this configuration generally needs to be added during the development process of SpirngMVC.

The above is the detailed content of What should I do if springmvc does not load css?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!