You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Tony Smith <qu...@yahoo.com> on 2005/06/25 17:01:15 UTC

use boolean field as property

I have a class

public class mybean{
    boolean isGood;

    public boolean getIsGood(){
        return isGood;
    }

    public void setIsGood(boolean good){
        this.isGood = good;
    }
}

Suppose I have a list of mybean, can I do this:

    <logic:iterate id="obj" name="mylist">
    <logic:equal name="obj" property="isGood"
value="true">
      xxxgood
    </logic:equal>
    </logic:iterate>
My app throws a exception saying:

 No bean found under attribute key obj

I do not know why




		
____________________________________________________ 
Yahoo! Sports 
Rekindle the Rivalries. Sign up for Fantasy Football 
http://football.fantasysports.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: use boolean field as property

Posted by Lucas Bern <lu...@yahoo.com.ar>.
Hia Tony, it seems that your bean is not what his ckass name says to be....
I mean, mybean, is not a JavaBean because it does not implement the getter for isGood attribute in a correct way... it should be

public class mybean{
boolean isGood;

public boolean isIsGood(){
return isGood;
}

public void setIsGood(boolean good){
this.isGood = good;
}
}

but, seeing your exception, it should not be your problem...
I think your list has a null, so in one of the iterations over mylist, you get a null under obj key...
 
Lucas
 
The thig is that the bean 
Tony Smith <qu...@yahoo.com> escribió:
I have a class

public class mybean{
boolean isGood;

public boolean getIsGood(){
return isGood;
}

public void setIsGood(boolean good){
this.isGood = good;
}
}

Suppose I have a list of mybean, can I do this:


value="true">
xxxgood


My app throws a exception saying:

No bean found under attribute key obj

I do not know why





____________________________________________________ 
Yahoo! Sports 
Rekindle the Rivalries. Sign up for Fantasy Football 
http://football.fantasysports.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis! 
¡Abrí tu cuenta ya! - http://correo.yahoo.com.ar