struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robinbajaj <>
Subject Re: [OT] problem with displaytag column sorting in struts 1.2 web project
Date Sun, 08 Apr 2007 19:59:38 GMT

thanks for the tip.
can you please provide more specific example/code-snippet for using the 
requestURI attribute. i couldnt find enough documentation on this feature. 
thanks in advance, 

Tim Williams wrote:
> On 4/8/07, robin bajaj <> wrote:
>> Hi All,
>> In my Struts 1.2.x webapp, I am getting some Patient records from
>> backend using my PatientManager businessObject (which uses Hibernate)
>> to send back a populated Patients List in the request scope. (Patient is
>> my bean).
>> I am feeding this patientsList to Displaytag table,
>> to show the data in a table.
>> Here's the code snippet for my jsp containing displaytag table.
>> Now, I want to sort this table based on the PatientID
>> when I click on the PatientID column.
>> I read in the Displaytag docs
>> where it mentions the following :
>> If you want to allow the user to sort the data as it is coming back,
>> then you need to just do two things, make sure that the data returned
>> from your property implements the Comparable interface (if it doesn't
>> natively - use the decorator pattern as shown a couple of examples ago),
>> and then set the attribute sortable="true" on the columns that you want
>> to be able to sort by.
>> Following the above suggestion, I changed my Patient class to implement
>> Comparable interface and implemented the following compareTo method (as
>> following)
>> Then I re-build my app and restart it on the server, the displaytag
>> table shows up fine. But when I click on the first column PtId, it
>> doesn't sort the table. I just get the Http404 error page.
>> Am I missing something ?
> Try setting the requestURI attribute of the table itself?
> --tim
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

View this message in context:
Sent from the Struts - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message