File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Problem in using display tag sorting with Struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Problem in using display tag sorting with Struts" Watch "Problem in using display tag sorting with Struts" New topic

Problem in using display tag sorting with Struts

Charanjit Sidhu

Joined: Apr 04, 2005
Posts: 13

I have a requirement of a table on a screen with the option of sorting on all columns. I was thinking that display tag will be a nice solution. But sorting is not working as the sorting link points to the JSP and my JSP is under WEB-INF and additionally in Struts we should always go through 'actions'.

I have the following in my JSP:
<display:column property="loanNumber" title="Loan #" sortable="true"/>

and the generated link on field 'Loan #' is:


Is there a solution to this problem or I will have to drop the idea of using Display tag for this requirement?


Charanjit Sidhu<br />SCJP 81%
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
I haven't really used the display tag library, so I couldn't help you much with information on what it does or doesn't do. If it needs to redisplay the page in the manner you've described, though, it doesn't look like it's going to work in your situation.

I've been using WebFX Sortable Table to sort my tables. This is an all javaScript solution that does not require the page to be submitted or redisplayed. If you determine that the display tags aren't going to work for you, you might give sortable table a try.
[ February 22, 2006: Message edited by: Merrill Higginson ]

Consultant, Sima Solutions
Hugh Heff

Joined: Jul 17, 2008
Posts: 1
You need to set the requestURI parameter.
e.g. for the action called 'layout':
<display:table .... requestURI="layout.action" ....>

where .... is whatever other parameters you have in the display table tag.

Kenneth J Medlock

Joined: Jul 15, 2005
Posts: 1
I was having exactly the same issue. Thanks for the fix.

Ken Medlock<br />Analyst/Programmer/Katie's Dad
I agree. Here's the link:
subject: Problem in using display tag sorting with Struts
jQuery in Action, 3rd edition