Situation recovery under:
Save a user through Valuestack, and then the page can ${user.sex} get the man. ${user.sex== ' man ' got ture.
But in using <s:if text= "${user.sex== '}" > Error <c:if text= "${user.sex== ' Man '}" > can be used
Analysis:
As we all know, Struts2 is enhanced with request, which is obtained from Valuestack when getattribute () cannot get the data.
It is logically not a problem to use the if of the S tag. But the S tag does not provide full support for El expression parsing. So it's going to be an error.
Solve:
<s:if test= "user.sex==\" male \ "" > Do not use El directly with the S-tag to get data with OGNL expression
Harvest
Harvest 1:
It's best not to mix expressions such as El (JSTL) and Ongl
Harvest 2:
Use as few single quotes as possible, because single quotes may not be supported, such as the OGNL expression in the S-tag library is not supported for single quotes.
Try to use double quotes Plus/escape as much as possible.
For an iterator using the/struts-tags tag library in a JSP page, the problem of getting parameters from Valuestack using El