// Copyright (c) 2003-2012, Jodd Team (jodd.org). All Rights Reserved.

package jodd.servlet;

import javax.servlet.jsp.PageContext;

/**
 * Thread local storage for <code>PageContext</code>.
 */
public class PageContextThreadLocal {

	private static final ThreadLocal<PageContext> THREAD_LOCAL = new ThreadLocal<PageContext>();

	/**
	 * Sets page context to thread local variable.
	 */
	public static void set(PageContext pageContext) {
		THREAD_LOCAL.set(pageContext);
	}

	/**
	 * Returns page context from thread local variable.
	 */
	public static PageContext get() {
		return THREAD_LOCAL.get();
	}
}

@@ -624,12 +624,122 @@
 ();%0D%0A%09%7D%0D
+%0A%0D%0A%09/**%0D%0A%09 * Clears thread local variable.%0D%0A%09 */%0D%0A%09public static void clear() %7B%0D%0A%09%09THREAD_LOCAL.remove();%0D%0A%09%7D%0D
 %0A%7D%0D%0A

clear added