Search code examples
javajspstruts2displaytag

Struts2 Property Tag in Display Tag


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)"/>

Solution

  • Try using

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

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