Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/spring-mvc/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何在@before中返回值作为响应,而不将out移动到控制器(使用AOP)_Java_Spring Mvc_Aop - Fatal编程技术网

Java 如何在@before中返回值作为响应,而不将out移动到控制器(使用AOP)

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

我使用的是AOP概念,调度器将调用发送到before advice方法。在这种情况下,如何在不进入控制器的情况下返回before-advice方法中的值

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