NOTE: This email assumes Struts 2. I'm not sure how Struts 1 works; it
may or may not be the same

On 8/14/07, Pedro Herrera <[EMAIL PROTECTED]> wrote:
>
> I´m very confused , when I must use ${ , # and %  ????
> What are the situations to use each one ?
>
> Thanks
>
> Herrera

I had the same problem when I started.
If you got a getVar() that struts can get the value of var from, you
can refer to it like:
<s:property value="%{var}" /> *

If you make a reference, eg
<s:url id="REFRESH" action="ThisAction" includeParams="none" />
you can use the # to refer to it:
<s:a href="%{#REFRESH}">

# is used for map/lists:
<s:radio name="allowThis" list="#{true:'Yes', false:'No'}" />

${} is used by JSP, not Struts, no I don't have any sample code to
share regarding it.

*I suspect in some cases you can refer to a Struts variable like:
"var" without the "%{}" but I'm not sure when/where.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to