문제

I'm looking for:

<s:set var="A_VARIABLE" value="<s:date name='OBJECT.MEMBER' format='XXX_FORMAT'/>"/>

Then, I want to manipulate #A_VARIABLE, but A_VARIABLE is not getting value from s:date.

도움이 되었습니까?

해결책

You cannot nest tags like that. Use <s:set> tag with body content. Put your <s:date> tag inside <s:set> tag.

<s:set var="A_VARIABLE">
  <s:date name="OBJECT.MEMBER" format="XXX_FORMAT"/>
</s:set>

다른 팁

The value of the value attribute, like other attributes in Struts2 tags is evaluated as OGNL expression and if it fails leaves the value as is.

The value is also has a meaning if you remove the value attribute and use the body of the tag.

You can't nest Struts tags inside Struts tag's attributes.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top