${} is for writing JSP EL, while %{} is for writing OGNL.  Both serve
similar purposes, and if you have a servlet container that supports
JSP EL and are running Struts 2, they can be used almost
interchangeably.  For more details you can read up on the JSP EL:
http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JSPIntro7.html and
using OGNL with Struts 2:
http://struts.apache.org/2.0.9/docs/ognl.html and
http://struts.apache.org/2.0.9/docs/tag-syntax.html

Josh

On 8/14/07, yitzle <[EMAIL PROTECTED]> wrote:
> 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]
>
>

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

Reply via email to