非action层获取HttpServletRequest
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();

浙公网安备 33010602011771号