AOP获取requset/response

阅读更多
HttpServletRequest request = ((ServletRequestAttributes) 
         RequestContextHolder.getRequestAttributes()).getRequest();
HttpServletResponse response = ((ServletRequestAttributes)
         RequestContextHolder.getRequestAttributes()).getResponse();
response.reset();
response.setContentType(MediaType.APPLICATION_JSON_VALUE);

你可能感兴趣的:(response)