Laurie Harper wrote:
The expressions %{name} and %{#name} have different meanings. Anywhere
one is valid, the other is valid too but obviously each will only 'work'
if the expression resolves to a value.
Correct. I'm sorry to pick nits, but if you don't mind, I'll clarify
your following statements in the hopes that this becomes clearer to more
people:
- %{name} will look for a property named 'name' on your action (i.e.
will result in a call to getName() on your action)
%{name} will look for "name" on the Value Stack. Typically while
executing in .jsp's the top item in that stack is your Action, but
within an iterator, for example, there might be something "on top of"
the Action, and there are always other objects below the Action.
OGNL will start at the top of the stack and search each object for a
getName() getter, returning the results of the first such getter found.
- %{#name} will look for a property or attribute named 'name' anywhere
in the value stack, including in the request/session/application scopes
%{#name} will not look in the value stack at all. It will look for a an
object named "name" stored in a separate Map<String,Object> separately
from the VS (Stack<Object>). Some struts tags push/pop items on to the
top of the VS, some just store in this hash. (Possibly some do both
when asked to, in which case it's the same object both in the VS and
directly referencible through that Map.)
AFAIK, %{#name} is equivalent to %{name} when there is a getName() on
the action, i.e. OGNL will look at the action first then search the rest
of the value stack.
AFAIK that is incorrect.
Special items in that Map:
#application
#session
#request
#parameters
I believe at least some of those are also in the VS.
#attr searches the normal (EL) scopes in normal (EL) order (application,
session, request, and page) (Note, #page is not in the Map.)
-Dale
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]