码迷,mamicode.com
首页 > 其他好文 > 详细

ThreadLocal<HttpServletResponse>

时间:2014-09-03 16:31:36      阅读:592      评论:0      收藏:0      [点我收藏+]

标签:blog   http   java   div   sp   log   on   c   new   

public class ResponseContextHolder {
	private static final ThreadLocal<HttpServletResponse> responseHolder = new NamedThreadLocal<HttpServletResponse>(
			"Response");

	public static void resetResponse() {
		responseHolder.set(null);
	}

	public static void setResponse(HttpServletResponse response) {
		responseHolder.set(response);
	}

	public static HttpServletResponse getResponse() {
		return responseHolder.get();
	}
}

  

ThreadLocal<HttpServletResponse>

标签:blog   http   java   div   sp   log   on   c   new   

原文地址:http://www.cnblogs.com/byshome/p/3953890.html

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