@Component
@Aspect
public class SysLogAspectJ {
@Autowired
private HttpServletRequest request;
web.xml
<listener>
<listener-class>
org.springframework.web.context.request.RequestContextListener
</listener-class>
</listener>
有人说用threadLocal 实现一下,其实看这个监听能发现也是用的这个方式。