In my previous work, when I encountered a JSP value in struts2, I was not quite clear about the usage of # % (although I learned it before when I learned struts2 ).
I met you again today and sorted it out.
Shows the struts2 context. The content in the value stack is usually used for the attribute values of the current action. You can use the S: Debug label to view the logs.
For values in the value stack in JSP:<S: Property Value="Artist. Bio" />
The values in the value stack can be "upgraded", and the Set tag is used. The scope can be used to specify the range to be upgraded:<S: Set Name="Artistname" Value="Artist. Name" Scope="Session" />
Value at this time:<S: Property Value="# Session ['artidname']" />
We can see that the value of # is added to the non-value stack (context). This is the ognl syntax.
Note the iterator label of struts2: <s: iterator value = "deptvo" Var = "Dept">
The variables defined by VAR are not in the value stack. I guess they are in ATTR (not sure. Please give me some advice ...). Therefore, the value must also be added with #: <s: property value = "# Dept. Manager. Gender"/>
Struts2 value Stack