Threadlocal 又成线程局部变量,
他为每一个使用该线程局部变量的线程提供了一个变量副本,使每一个线程都可以独立的改变自己的副本,不会和其它线程的副本冲突
存放在actionContext里的数据都存放在ThreadLocal里,threadLocal支队当前线程可见,因此它是线程安全的
下面看看actionContext里有那先数据:
public class ActionContext implements Serializable {
static ThreadLocal<ActionContext> actionContext = new ThreadLocal<ActionContext>();
/**
* Constant for the name of the action being executed.
*/
public static final String ACTION_NAME = "com.opensymphony.xwork2.ActionContext.name";
public static final String VALUE_STACK = ValueStack.VALUE_STACK;