Controller方法上自定义注解

定义自定义注解 1@Retention(RetentionPolicy.RUNTIME) 2@Target(ElementType.PARAMETER) 3public @interface Logined { 4} 注解处理器 1@Component 2@Slf4j 3public class LoginedArgumentResolver implements HandlerMethodArgumentResolver { 4 @Override 5 public boolean supportsParameter(MethodParameter parameter) { 6 return …

HandlerMapping

Spring HandlerMapping 1package org.springframework.web.servlet; 2 3import javax.servlet.http.HttpServletRequest; 4 5import org.springframework.lang.Nullable; 6 7public interface HandlerMapping { 8 // 省略一下常量配置..... 9 /** 10* 返回此请求的处理程序和任何拦截器。可以根据请求URL、会话状态或实现类选择