Struts2 - Nesting <s:property> in a custom tag
I have a custom struts2 tag:
<s:myTag myprop="..." >
...
</s:mytag>
And, I want to get the value of myprop
attribute of myTag
from the ValueStack
.
Like,
<s:myTag myprop='<开发者_如何学Pythons:property value="name"/>'>
So, I tried setting the rtexprvalue
attribute for myprop
to true
but, still I am not able to see the <s:property/>
nested inside the custom tag getting evaluated.
There is no error/exception, its just that the nested <s:property/>
is not getting evaluated.
Can someone help me know how to get this working?
Thanks.
Try
<s:myTag>
<s:param name="myprop">
${name}
</s:param>
</s:mytag>
OR
<s:myTag>
<s:param name="myprop" value="name" />
</s:mytag>
OR (Static Content)
<s:myTag>
<s:param name="myprop">
<s:property value="@some.package.ClassName@FOO_PROPERTY" />
</s:param>
</s:mytag>
精彩评论