Springmvc custom interceptor implements the interception of unlogged users

Step 1: Write a custom interceptor class, which inherits HandlerInterceptorAdapter and overrides the preHandle method
Write picture description here

Step 2: Configure the springmvc.xml file and define the interceptor properties
Write picture description here

The mapping of the login request should not start with sys, otherwise it will also be intercepted

Guess you like

Origin blog.csdn.net/ouyangli2011/article/details/78631762