首页 > 编程语言 > 详细

java web

时间:2015-08-29 15:17:37      阅读:116      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!