请问 aop中 BufferedReader reader = request.getReader(); 不能读取 会抛出异常
来源:7-3 获取code
jvpchao3809780
2018-03-15
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); HttpServletRequest request =attributes.getRequest(); BufferedReader reader = request.getReader();
会抛出getInputStream() has already been called for this request这个异常
如果用
Object[] args = joinPoint.getArgs();
args是null
在网上找的解决方案如下
@Configuration public class RequestConfig { @Bean public HiddenHttpMethodFilter hiddenHttpMethodFilter() { return new OrderedHiddenHttpMethodFilter(){ @Override protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException { filterChain.doFilter(request, response); } }; } }
但是依然没用 就师兄帮忙解惑一下呢
写回答
1回答
-
你是要获取什么内容,我代码里不是这样写的吧
022018-03-16