*
The moose likes Struts and the fly likes Struts 2 tags: %{bla bla} what is the percentage notation used for? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts 2 tags: %{bla bla} what is the percentage notation used for?" Watch "Struts 2 tags: %{bla bla} what is the percentage notation used for?" New topic
Author

Struts 2 tags: %{bla bla} what is the percentage notation used for?

Hermann Maurer
Greenhorn

Joined: Oct 19, 2009
Posts: 4
Hello,

I don't get over the hump with '%{', google did not resolve for me:-(

I take an example from the following link, as it used heavily the '%{':
http://www.javaworld.com/javaworld/jw-10-2007/jw-10-struts2inaction.html?page=4


value="%{id}" />
<s:textfield
name="ngContainerVO.ngAttributes[%{#stat.index}].value"
value="%{value}" label="%{displayName}" title="%{description}" />

In general:
'#' is used to access the value stack of struts
'${' is used for Expression Language (which is not used in struts)
'%{' I don't know what it is ??? Maybe someone is so kind to explain this with an example ???

Help is very much appreciated.

Many thanks,
Hermann


David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Moved to the Struts forum.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

It's the OGNL escape notation, just like ${} is the JSP EL escape.
Hermann Maurer
Greenhorn

Joined: Oct 19, 2009
Posts: 4
Thanks for the fast reply!

BR/Hermann
 
Don't get me started about those stupid light bulbs.
 
subject: Struts 2 tags: %{bla bla} what is the percentage notation used for?