首页 > 代码库 > ThreadLocal<HttpServletResponse>

ThreadLocal<HttpServletResponse>

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>