<INPUT TYPE = "TEXT" NAME="ISEXIST"/>
public class BasisAction
{
      boolean isExist = false;
      ..............
}isExist在html中值怎么设置才能赋值给Action中的isExist.

解决方案 »

  1.   

    可以在input中输入"true",那么action中得到的是true,其他的都是false.
    其实可以用一个String接收,然后在方法中判断后赋给一个boolean值.
      

  2.   

     public class TestAction {
    private boolean bool;


    public boolean isBool() {
    return bool;
    }
    public void setBool(boolean bool) {
    this.bool = bool;
    }
    public String execute() {
    System.out.println(bool);
    return "success";
    }
    }
    这个是struts2,其他的应该也同理..