码迷,mamicode.com
首页 > 编程语言 > 详细

java web

时间:2015-08-29 15:19:05      阅读:159      评论:0      收藏:0      [点我收藏+]

标签:

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();

 

java web

标签:

原文地址:http://www.cnblogs.com/predisw/p/4769157.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!