public class SmsClientAction extends DispatchAction {
int temp;
public ActionForward getA(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
{
temp = 1;
System.out.println("A"+temp);
}
public ActionForward getB(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
{
temp = 2;
System.out.println("B"+temp);
}
}
}
如上所示。我做个线程里面循环 同时请求getA 和getB 会不会产生temp值乱了的问题? 如果int temp定义为private 呢?