spring aop 中获取 request
使用aop时需要request 和response
使用方法调用时
HttpServletRequest request = ((ServletRequestAttributes)RequestContextHolder.getRequestAttributes()).getRequest();
一直报空指针
结果在web.xml中加入一下监听即可
<listener>
<listener-class>
org.springframework.web.context.request.RequestContextListener
</listener-class>
</listener>