${}
- Standard JSP EL notation.
#{}
- Standard UEL notation; never used it, may work.
%{}
- OGNL expression notation.
JSP EL notation works because there's a request wrapper that will defer to the value stack for lookups first, then fall back to the normal JSP evaluation if there's no value found on the value stack.
OGNL expression notation is valid only within S2 tags. IMO it should be used whenever you are evaluating an OGNL expression, although it is quite often optional. When it is optional is somewhat of a crap shoot, however. It often is, buuuut not always. Best to use it and be explicit and communicative.
You may be asking about #
variables, like #session
etc. #
is used to resolve a value on the value stack that's in the "map" portion. I view the value stack as a combination stack and scope: if an object has been pushed on the stack, you don't need the #
. If a value has been created, you need the #
.
For example, if you use <s:set>
to create a variable, you must access it using a #
prefix, like:
<s:set var="foo" value="'plugh'"/>
<s:property value="#foo"/>