title: make a button disable/enable base on java flg in the struts2
body: <p>Action:</p>
  
  <pre class="lang-java prettyprint-override"><code>public class TuAction() extends ActionSupport{
  
      private boolean loseItemFlg=false;
  
      private String doFuilureOrder(){
          if(...){
             loseItemFlg=true;
          }
          return SUCCESS;
      }
  
      public boolean isLoseItemFlg() {
          return loseItemFlg;
      }
  
      public void setLoseItemFlg(boolean loseItemFlg) {
          this.loseItemFlg = loseItemFlg;
      }
  }
  </code></pre>
  
  <p>And my Jsp:</p>
  
  <pre class="lang-js prettyprint-override"><code>function dialogOpen(formName,actionName){
      if(comfirm("do you want do this?")){
          ....
          document.forms[formName].action=actionName;
          document.forms[formName].submit();
      }else{
          //i want do not reload the page.
      }
  }
  </code></pre>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;input type="button" disable="%{loseItemFlg}" value="lose" 
      onclick="dialogOpen('tuAction', '&lt;%request.getContextPath()%&gt;/tuAction_doFuilureOrder.action')" 
  /&gt;
  </code></pre>
  
  <p>But this code the button's disable property is not by my control!!
  Then i change the jsp to:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;s:submit type="button" disable="%{loseItemFlg}" value="lose"
         onclick="dialogOpen('tuAction', '&lt;%request.getContextPath()%&gt;/tuAction_doFuilureOrder.action')" 
  /&gt;
  </code></pre>
  
  <p>Now the button's disable property is by my control,but the <code>"doFuilureOrder()"</code> is not by used.</p>
  
  <p>About do not reload the page should do what in my jsp.</p>
  
  <p>My English is terrible,And this is my first time to use the stackoverflow. Someone know what I means.</p>