找到了解决方案。
import org.aspectj.lang.reflect.MethodSignature;import java.lang.reflect.Method;@Pointcut("within(@org.springframework.stereotype.Controller *)")public void controller() {}// In adviceMethodSignature methodSignature = (MethodSignature) joinPoint.getSignature();Method method = methodSignature .getMethod();RequestMethod[] requestMethods = method.getAnnotation(RequestMapping.class).method();请注意要导入的类。



