display tag sorting duplicate the last action perf

2019-08-13 17:05发布

I have display tag like this.

<display:table class="displayTable" id="orgList"
                 name="${sessionScope.organisationArray}" requestURI="" pagesize="13"
                defaultsort="1" sort="list">
          <display:column property="organisationName"
                title="Organisation Name" sortable="true" headerClass="sortable"/>
          <display:column property="description" title="Description" />
</display:table>

I got the ArrayList of the data from Session.

The problem is whenever I click to sort the Organisation Name column, it automatically performs the last action. For example, I add a new organistation, then I back to the list. And I click to sort, then adding of a new organisation perform again.

When I check the URL on the sortable column, it is pointing to the last action (Add action ) URL. If last action is delete, it is pointing to Delete action. Second time click on sortable column is OK, it works well.

But just first time straight back from another action, sorting is duplication the same action. How can I overcome this problem?

Thanks ahead.

1条回答
贪生不怕死
2楼-- · 2019-08-13 17:53

Finally I fix it just by adding requestURI="blahblah.action" which is an action just to display all the list.

Thanks to the following link: coderanch.com/t/53098/Struts/display-tag-sorting-Struts Thanks.

please check this link for detail info.

查看更多
登录 后发表回答