On Mon, Jun 15, 2009 at 6:40 AM, chumbobumbo<chumbobu...@hotmail.com> wrote: > > I am using Struts 2.1.6 > > if I have model like this: > > public class model { > private Boolean testBool; > private boolean testbool; > > ... > public getters and setters for both follow > ... > } > > I find that in my corresponding jsp page (assumming that both testbool and > testBool are initialised to true and that private member 'model' is > available through its getter and a setter from within the action class) > > <s:if test="%{model.testbool}"/> evaluates to true, while > <s:if test="%{model.testBool}"/> does not > > I am highly suspicious that I may be doing something fundamentally wrong as > there is a complete absence of posts out there complaining about not being > able to evaluate Boolean. > > Is there something I am missing here? > > Any help is appreciated, > > Regards, > > C
Try this - <s:if test="%{model.testBool.booleanValue()}"/> I could be wrong, I thought modern JVMs supported auto-boxing, etc. making these sorts of method calls redundant. However, I am never quite sure how OGNL is going to evaluate things until I play around with it. -Wes -- Wes Wannemacher Author - Struts 2 In Practice Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more http://www.manning.com/wannemacher --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org