struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Pontarelli <>
Subject Thoughts on JSPs and OGNL
Date Sun, 27 Jan 2008 20:10:22 GMT
Just to preface this email, I've never been a big OGNL fan...

Okay, I'm updating everything to 2.1.1 and the new convention plugin and 
realized a major change from 2.0.9 to 2.1.1 is that the struts tags no 
longer accept JSP expressions, which has caused some major headaches. I 
could change the tld, but that's non-standard with Struts. My last email 
about compatibility didn't really get any responses and I think that it 
is really important overall. Upgrading between 2.0 and 2.1 is gonna be 
painful and it is something that should probably be documented.

Here's some thoughts after having done some upgrading and also worked 
with very green developers and loads of different clients over the last 

- The fact that some attributes take OGNL directly, some via aliases 
like %{} and some not at all is REALLY confusing and cumbersome

- OGNL itself is strange since it has a tree structure and the # syntax 
is confusing for new developers

- I still haven't figured out a way to get at some JSP concepts such as 
include parameters (i.e. <jsp:param> values) and this requires hacks like:

  <c:set name="foo" value="${param['foo']}"/>
  <s:hidden name="foo" value="%{}"/>

  (yeah %{} doesn't work for some reason. If someone 
knows the fix, let me know)

- Different syntax to get values from objects inside and outside tags in 
a JSP - on the page is JSP EL (required so you don't get nested XML and 
your code can be XML validated) and OGNL in the tags. This is not so 

- Not well documented what is available from OGNL in the JSP

Thus far I haven't found any major benefit to OGNL in any of my 
applications. I'm certain others have, but I would guess these are 
minimal and could be handled by some ognl tag like <ognl:eval/>.

I know there are some folks trying to update to the UEL and this is 
somewhat of thinking out loud about moving this timeline up to 2.1.1 or 
the immediate next release. It would seem that this will make things a 
lot more standard overall. Anything I can do to help, just let me know.


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

View raw message