如何更改struts动作类中声明的静态全局变量 [英] How to change the static global variale declared in struts action class

查看:84
本文介绍了如何更改struts动作类中声明的静态全局变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在struts-action类中定义了全局静态布尔变量。如何从其他Action类更改其值。



I have global static boolean variable defined in struts-action class. How do i change its value from other Action class.

public class MyAction extends Action
{
   public static boolean existsFlag = false;

   public ActionForward execute(ActionMapping mapping,
       ActionForm actionForm, HttpServletRequest request,
       HttpServletResponse response)
   throws Exception
   {
      int a=10;
      if(a==10)
      {
         existsFlag = true; // is this ok to use
      }
   return mapping.findForward("successDisplayForm");
   }
}





我还有另一个Action类,我要将此值设置为'false '当交易完成时。



请帮助。



注意:使用Struts-1.3



Also I have another Action class, where i want to set this value to 'false' when transaction gets completed.

Please help.

Note : Using Struts-1.3

推荐答案

这篇关于如何更改struts动作类中声明的静态全局变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆