You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Dale Newfield <da...@newfield.org> on 2009/10/13 21:27:24 UTC

Re: How to get value of tag attribute from OGNL?

Alex Siman wrote:
>>> I switched off the JSTL-EL (as it was recomended in Struts2 wiki)
>> Can you please point me to that?  Seems quite strange to me...
> 
> Read the section "JSP 2.1" here: 
> http://struts.apache.org/2.1.8/docs/ognl.html

That was added by Ted Husted on 3/23/2007.

What are the problems that this addresses?  It seems that the cure is 
worse than the disease of having to escape a few #'s here and there 
(none in my codebase), especially after we've since restricted all the 
struts tags with rtexprvalue=false...

-Dale

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: How to get value of tag attribute from OGNL?

Posted by Dale Newfield <da...@newfield.org>.
Musachy Barroso wrote:
> hum, yeah after rtexprvalue=false it should work fine, please edit the wiki :)

Done.

-Dale

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: How to get value of tag attribute from OGNL?

Posted by Musachy Barroso <mu...@gmail.com>.
hum, yeah after rtexprvalue=false it should work fine, please edit the wiki :)

musachy

On Tue, Oct 13, 2009 at 12:42 PM, Dale Newfield <da...@newfield.org> wrote:
> Musachy Barroso wrote:
>>
>> that's only a problem for defining maps in ognl, which used the
>> "#{a:b}" syntax, which made the jstl el complain. The solution is just
>> to use the alternative map syntax:
>>
>> #@java.util.LinkedHashMap@{ "foo" : "foo value", "bar" : "bar value" }
>>
>>
>> http://www.opensymphony.com/ognl/html/LanguageGuide/collectionConstruction.html#mapConstruction
>
> I have places in my current codebase where I use the #{a:b} syntax without
> issue.  Does jstl-el not complain because I added those since the
> rtexprvalue=false change?  If so, anyone mind if I remove that portion of
> the wiki page (replacing it with a link to the ognl mapContruction link)?
>
> -Dale
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: How to get value of tag attribute from OGNL?

Posted by Dale Newfield <da...@newfield.org>.
Musachy Barroso wrote:
> that's only a problem for defining maps in ognl, which used the
> "#{a:b}" syntax, which made the jstl el complain. The solution is just
> to use the alternative map syntax:
> 
> #@java.util.LinkedHashMap@{ "foo" : "foo value", "bar" : "bar value" }
> 
> http://www.opensymphony.com/ognl/html/LanguageGuide/collectionConstruction.html#mapConstruction

I have places in my current codebase where I use the #{a:b} syntax 
without issue.  Does jstl-el not complain because I added those since 
the rtexprvalue=false change?  If so, anyone mind if I remove that 
portion of the wiki page (replacing it with a link to the ognl 
mapContruction link)?

-Dale

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: How to get value of tag attribute from OGNL?

Posted by Musachy Barroso <mu...@gmail.com>.
that's only a problem for defining maps in ognl, which used the
"#{a:b}" syntax, which made the jstl el complain. The solution is just
to use the alternative map syntax:

#@java.util.LinkedHashMap@{ "foo" : "foo value", "bar" : "bar value" }

http://www.opensymphony.com/ognl/html/LanguageGuide/collectionConstruction.html#mapConstruction

On Tue, Oct 13, 2009 at 12:27 PM, Dale Newfield <da...@newfield.org> wrote:
> Alex Siman wrote:
>>>>
>>>> I switched off the JSTL-EL (as it was recomended in Struts2 wiki)
>>>
>>> Can you please point me to that?  Seems quite strange to me...
>>
>> Read the section "JSP 2.1" here:
>> http://struts.apache.org/2.1.8/docs/ognl.html
>
> That was added by Ted Husted on 3/23/2007.
>
> What are the problems that this addresses?  It seems that the cure is worse
> than the disease of having to escape a few #'s here and there (none in my
> codebase), especially after we've since restricted all the struts tags with
> rtexprvalue=false...
>
> -Dale
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: How to get value of tag attribute from OGNL?

Posted by Musachy Barroso <mu...@gmail.com>.
that's only a problem for defining maps in ognl, which used the
"#{a:b}" syntax, which made the jstl el complain. The solution is just
to use the alternative map syntax:

#@java.util.LinkedHashMap@{ "foo" : "foo value", "bar" : "bar value" }

http://www.opensymphony.com/ognl/html/LanguageGuide/collectionConstruction.html#mapConstruction

On Tue, Oct 13, 2009 at 12:27 PM, Dale Newfield <da...@newfield.org> wrote:
> Alex Siman wrote:
>>>>
>>>> I switched off the JSTL-EL (as it was recomended in Struts2 wiki)
>>>
>>> Can you please point me to that?  Seems quite strange to me...
>>
>> Read the section "JSP 2.1" here:
>> http://struts.apache.org/2.1.8/docs/ognl.html
>
> That was added by Ted Husted on 3/23/2007.
>
> What are the problems that this addresses?  It seems that the cure is worse
> than the disease of having to escape a few #'s here and there (none in my
> codebase), especially after we've since restricted all the struts tags with
> rtexprvalue=false...
>
> -Dale
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org