Also, in <s:if ...> tags, you don't need to enclose the test in %{} because it
is evaluated anyway. Not that it'll change your result at all, just thought I'd
save you the extra couple of keypresses.
> -----Original Message-----
> From: Wes Wannemacher [mailto:[email protected]]
> Sent: Monday, June 15, 2009 9:01 AM
> To: Struts Users Mailing List
> Subject: Re: Newbie (possibly RTFM) issue
>
> On Mon, Jun 15, 2009 at 6:40 AM,
> chumbobumbo<[email protected]> 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: [email protected]
> For additional commands, e-mail: [email protected]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]