Java 如何在@before中返回值作为响应,而不将out移动到控制器(使用AOP)
我使用的是AOP概念,调度器将调用发送到before advice方法。在这种情况下,如何在不进入控制器的情况下返回before-advice方法中的值Java 如何在@before中返回值作为响应,而不将out移动到控制器(使用AOP),java,spring-mvc,aop,Java,Spring Mvc,Aop,我使用的是AOP概念,调度器将调用发送到before advice方法。在这种情况下,如何在不进入控制器的情况下返回before-advice方法中的值 public Object cache(JoinPoint jointPoint, RedisCache redisCache) throws Throwable{ String data = getRedisService().getValue(redisKey); if(data != null){return "hi";} } : B
public Object cache(JoinPoint jointPoint, RedisCache redisCache) throws Throwable{
String data = getRedisService().getValue(redisKey);
if(data != null){return "hi";}
}
:
Before advice runs before a matched method execution
It has the opportunity to do work both before and after the method
executes, and to determine when, how, and even if, the method actually
gets to execute at all