You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Brian Pontarelli <br...@pontarelli.com> on 2008/01/27 21:10:22 UTC
Thoughts on JSPs and OGNL
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
year:
- 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="%{#attr.foo}"/>
(yeah %{#parameters.foo} 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
pleasant
- 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.
-bp
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Re: Thoughts on JSPs and OGNL
Posted by Brian Pontarelli <br...@pontarelli.com>.
I'm gonna try and much a list of a areas that OGNL touches today so we
have good context about the full stack.
-bp
Tom Schneider wrote:
> Unfortunately, I haven't had much (any) time to work on s2 at all
> since December. Feel free to poke around and see how far you can get.
> Tom
>
> Brian Pontarelli wrote:
>> Tom Schneider wrote:
>>> Brian,
>>> I worked on Unfied EL a bit towards the end of last year:
>>> http://cwiki.apache.org/S2PLUGINS/unified-el-plugin.html I was able
>>> to get it working for basic expressions, but it is nowhere near
>>> ready for production. It would need a lot more coding/testing
>>> before it would even be considered beta status. I also think there
>>> are some fundamental limits to what can be done with standard JSP
>>> unified el. From my investigation, I'm not sure we could support
>>> all of the cool stuff we can do with OGNL. Another possibility is
>>> that Jesse talked about adding a UEL compatability layer to OGNL. I
>>> haven't followed up so I'm not sure if that went anywhere.
>> My feeling is that the "cool stuff" with OGNL is probably better
>> suited for an action or somewhere else and even if it needed to be in
>> the page it could be handled via an OGNL tag. It would be nice to use
>> the same syntax anywhere on the JSP including in and out of tags. I
>> would even think that we could cover the majority of the cases using
>> UEL ${} syntax rather than the #{} syntax.
>>
>> Here's another example. I was using the s:action tags quite a bit for
>> invoking setup actions and for creating select boxes and such. From
>> 2.0.9 to 2.1.1 this broke. I used to be able to set into the s:param
>> an OGNL list and it would end up in the action just fine. Now it
>> doesn't work. It would be nice to just use JSP EL since I can pass in
>> a list object and the container is responsible for finding the object
>> and setting it into the taglib. So, now I just pass in a String and
>> for figure everything out myself, because I know it won't ever break
>> across versions of Struts and OGNL.
>>
>> If you want some help with the UEL stuff, let me know. I'd definitely
>> like to see one language that is simple and efficient.
>>
>> -bp
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
>> For additional commands, e-mail: dev-help@struts.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Re: Thoughts on JSPs and OGNL
Posted by Tom Schneider <sc...@gmail.com>.
Unfortunately, I haven't had much (any) time to work on s2 at all since
December. Feel free to poke around and see how far you can get.
Tom
Brian Pontarelli wrote:
> Tom Schneider wrote:
>> Brian,
>> I worked on Unfied EL a bit towards the end of last year:
>> http://cwiki.apache.org/S2PLUGINS/unified-el-plugin.html I was able
>> to get it working for basic expressions, but it is nowhere near ready
>> for production. It would need a lot more coding/testing before it
>> would even be considered beta status. I also think there are some
>> fundamental limits to what can be done with standard JSP unified el.
>> From my investigation, I'm not sure we could support all of the cool
>> stuff we can do with OGNL. Another possibility is that Jesse talked
>> about adding a UEL compatability layer to OGNL. I haven't followed
>> up so I'm not sure if that went anywhere.
> My feeling is that the "cool stuff" with OGNL is probably better
> suited for an action or somewhere else and even if it needed to be in
> the page it could be handled via an OGNL tag. It would be nice to use
> the same syntax anywhere on the JSP including in and out of tags. I
> would even think that we could cover the majority of the cases using
> UEL ${} syntax rather than the #{} syntax.
>
> Here's another example. I was using the s:action tags quite a bit for
> invoking setup actions and for creating select boxes and such. From
> 2.0.9 to 2.1.1 this broke. I used to be able to set into the s:param
> an OGNL list and it would end up in the action just fine. Now it
> doesn't work. It would be nice to just use JSP EL since I can pass in
> a list object and the container is responsible for finding the object
> and setting it into the taglib. So, now I just pass in a String and
> for figure everything out myself, because I know it won't ever break
> across versions of Struts and OGNL.
>
> If you want some help with the UEL stuff, let me know. I'd definitely
> like to see one language that is simple and efficient.
>
> -bp
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Re: Thoughts on JSPs and OGNL
Posted by Brian Pontarelli <br...@pontarelli.com>.
Tom Schneider wrote:
> Brian,
> I worked on Unfied EL a bit towards the end of last year:
> http://cwiki.apache.org/S2PLUGINS/unified-el-plugin.html I was able
> to get it working for basic expressions, but it is nowhere near ready
> for production. It would need a lot more coding/testing before it
> would even be considered beta status. I also think there are some
> fundamental limits to what can be done with standard JSP unified el.
> From my investigation, I'm not sure we could support all of the cool
> stuff we can do with OGNL. Another possibility is that Jesse talked
> about adding a UEL compatability layer to OGNL. I haven't followed up
> so I'm not sure if that went anywhere.
My feeling is that the "cool stuff" with OGNL is probably better suited
for an action or somewhere else and even if it needed to be in the page
it could be handled via an OGNL tag. It would be nice to use the same
syntax anywhere on the JSP including in and out of tags. I would even
think that we could cover the majority of the cases using UEL ${} syntax
rather than the #{} syntax.
Here's another example. I was using the s:action tags quite a bit for
invoking setup actions and for creating select boxes and such. From
2.0.9 to 2.1.1 this broke. I used to be able to set into the s:param an
OGNL list and it would end up in the action just fine. Now it doesn't
work. It would be nice to just use JSP EL since I can pass in a list
object and the container is responsible for finding the object and
setting it into the taglib. So, now I just pass in a String and for
figure everything out myself, because I know it won't ever break across
versions of Struts and OGNL.
If you want some help with the UEL stuff, let me know. I'd definitely
like to see one language that is simple and efficient.
-bp
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Re: Thoughts on JSPs and OGNL
Posted by Tom Schneider <sc...@gmail.com>.
Brian,
I worked on Unfied EL a bit towards the end of last year:
http://cwiki.apache.org/S2PLUGINS/unified-el-plugin.html I was able to
get it working for basic expressions, but it is nowhere near ready for
production. It would need a lot more coding/testing before it would
even be considered beta status. I also think there are some fundamental
limits to what can be done with standard JSP unified el. From my
investigation, I'm not sure we could support all of the cool stuff we
can do with OGNL. Another possibility is that Jesse talked about adding
a UEL compatability layer to OGNL. I haven't followed up so I'm not
sure if that went anywhere.
Tom
Brian Pontarelli wrote:
> 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 year:
>
> - 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="%{#attr.foo}"/>
>
> (yeah %{#parameters.foo} 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 pleasant
>
> - 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.
>
> -bp
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org