Struts2 Property Tag in Display Tag

自作多情 提交于 2019-12-24 08:48:39

问题


I have the following:

<display:table id="tbl" name="list" pagesize="3">
    <display:column title="COLUMN">
        ${tbl.date}
    </display:column>
</display:table>

The above works but I want to replace ${tbl.date} with Struts2 tag property to call static method.

Replacing ${tbl.date} with <s:property value="%{#tbl.date}"/> didn't work. I will be using tbl.date as parameter in calling static method in Struts2.:

<s:property value="@SomeStaticClass@method(tbl.date)"/>

回答1:


Try using

<s:property value="%{@SomeStaticClass@method(#attr.tbl.date)}"/>

after adding uid="tbl" to <display:table>



来源:https://stackoverflow.com/questions/14950039/struts2-property-tag-in-display-tag

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!