问题
I don't understand this author: context, properties of the default or root object. ..based on a context
I'm stuck at reading this portion of the tutorial:
http://www.tutorialspoint.com/struts_2/struts_value_stack_ognl.htm
"The OGNL is very similar to the JSP Expression Language. OGNL is based on the idea of having a root or default object within the context. The properties of the default or root object can be referenced using the markup notation, which is the pound symbol. As mentioned earlier, OGNL is based on a context and Struts builds an ActionContext map for use with OGNL. The ActionContext map consists of the following:..."
What does author mean when he writes:
"idea of having a root or default object within the context."
"OGNL is based on a context"
..what is this context thing??
it's extremely frustrating.
回答1:
Answering your questions in the following order:
OGNL has a context or context map on which it operates. Framework sets it to action context.
A root
is a default object in the context map and all objects it contains could be referenced without #
. Framework sets this object to value stack.
References:
- OGNL
- OGNL Basics
来源:https://stackoverflow.com/questions/24639743/what-is-action-context-in-struts-2