struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Pratt" <>
Subject Re: OGNL Insanity
Date Sat, 23 Feb 2008 00:23:43 GMT
On Fri, Feb 22, 2008 at 4:10 PM, Dave Newton <> wrote:
> --- Chris Pratt <> wrote:
>  > I am seeing the most unexplainable results imaginable.  I have the
>  > following line of OGNL:
>  >
>  >  '<s:property value="%{#parameters.display}"/>' == 'dependent':
>  > <s:property value="%{#parameters.display == 'dependent'}"/>
>  >
>  > Which is outputting:
>  >
>  > 'dependent' == 'dependent': false
>  >
>  > How is that even possible?  I am writing out the value of the display
>  > request parameter and it's value is the string 'dependent'.  When I
>  > use the very same struts tag to evaluate the expression, it returns
>  > false?  What am I missing here?
>  <s:property value="#parameters.display.class"/>

Dave, thanks for the cryptic reply, it pointed me in the right
direction.  I wasn't crazy about OGNL before and it's stuff like this
that makes me like it even less.

The whole point of an EL is to be usable by everyone from simple HTML
coders all the way up to mighty Java folks.  I thought we stopped
requiring Java coding in the HTML long ago.

But now OGNL is bringing it right back.  In order to use OGNL you have
to understan not only the datastructures used to hold data used on the
server side (String vs String[] vs Map vs List), but you also have to
remember where everything is.

The old JSP EL might have been simplistic, but that was one of it's
greatest benefits, you could guess with ~100% accuracy what any
statement was going to do.

Sorry to vent, but the more I use OGNL the more frustrated I get.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message