欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

AOP获取requset/response response 

程序员文章站 2022-04-23 16:54:26
...
HttpServletRequest request = ((ServletRequestAttributes) 
         RequestContextHolder.getRequestAttributes()).getRequest();
HttpServletResponse response = ((ServletRequestAttributes)
         RequestContextHolder.getRequestAttributes()).getResponse();
response.reset();
response.setContentType(MediaType.APPLICATION_JSON_VALUE);
相关标签: response