Struts2 Property Tag in Display Tag

2019-07-29 23:25发布

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条回答
做自己的国王
2楼-- · 2019-07-29 23:44

Try using

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

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

查看更多
登录 后发表回答