Kwa Kil On Swa

Saturday, December 16, 2006

wacky characters in webwork struts

%{}
===============================================

<s:textfield label="%{getText('eqnm.label')}" name="query.equipmentNm" value="%{query.equipmentNm}" />

See also page 234 in web work in action

The %{} allows you to put in an ongl expression between the baces embedded within a string.
(ognl is in struts2/webwork).


From: http://cwiki.apache.org/WW/tag-syntax.html
Using an expression to set the label
<s:textfield label="%{getText("postalCode.label")}" name="postalCode"/>
The expression language (OGNL) lets us call methods and evaluate properties.
The method getText is provided by ActionSupport, which is the base class for most Actions.
Since the Action is on the stack, we can call any of its methods from an expression, including getText.


#parameters.size
==============================================


<%= %>
==============================================
Standard Jsp expressions (not used in appfuse)
<%= ((ShoppingCart) session.get("cart")).getId() %>




Velocity uses $member.firstName.
Freemarker uses ${member.firstName}

0 Comments:

Post a Comment

<< Home