public class MyAction extends Action {
private Ojbect a=..;
public ActionForward execute(.....){
Ojbect b=...;
}
}b 是线程安全的,a 如果只读,也是线程安全的。
private Ojbect a=..;
public ActionForward execute(.....){
Ojbect b=...;
}
}b 是线程安全的,a 如果只读,也是线程安全的。
调试欢乐多
private HttpSession a=..; //会有同步问题 public ActionForward execute(.....){
HttpSession b=...; //线程安全
}
}