Completely solve the situation that springmvc web development tomcat requests html files to be intercepted by the controller

Completely solve the situation that springmvc web development tomcat requests html files to be intercepted by the controller!

Recently, the website has been developed and uploaded to the remote server. everything is normal. However, the client company requires uploading a verification file of Baidu webmaster, which is in html format. I threw it directly to the root directory of the website at first, and I couldn’t access it.

Later, I thought of the interceptor configured in spring-mvc.xml.

All /* addresses will be intercepted by the front controller, and need to be processed by the controller before they can be accessed. However,

It is impossible for me to modify and add a controller because of this html page. unnecessary.

Here is the solution:

Enter the spring-mvc.xml configuration file,

Add a new configuration item.

Add this to normal access.

If you need help, you can leave a message at any time. Or add me on WeChat.

Y554371521.

Guess you like

Origin blog.csdn.net/yrldjsbk/article/details/129097491