How SpringBoot: uses AOP to intercept requests with a parameter type of JSON

input parameter format is JSON instead of ordinary string, such as:

    {
        "REQUEST": {
            "page": "1",
            "rows":"20"
        }
    }

the JSON input parameter can be parsed through @ RequestBody String REQUEST in a normal Controller, but how to get such an input parameter in the custom section class RequestInterceptor? Cannot get

through request.getParameter () because the input parameter is a JSON string
@Aspect
@Component
public class RequestInterceptor {
    
    @Autowired
    private HttpServletRequest request;    

    @Pointcut("execution(* com.api.controller..*.*(..))")
    public void point() {
    }

    @Before(value = "point()")
    public void doBefore(JoinPoint joinPoint) throws Throwable {
        // 
    }
    
}
Aug.12,2021

seems to have found a feasible solution:
from-request/10458119-sharp10458119" rel=" nofollow noreferrer "> https://stackoverflow.com/que.

Menu