标签:
1.如何在一个线程的任何地方(即其他层)获取 HttpServletRequest
In every request, the DispatcherServlet
binds the current HttpServletRequest
to a static ThreadLocal
object in the RequestContextHolder
. You can retrieve it when executing within the same Thread
with
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.currentRequestAttributes()).getRequest();
标签:
原文地址:http://www.cnblogs.com/predisw/p/4769157.html