• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to sort the result return from a web service.

 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All:

I am using Weblogic 9.2, Web Services Client, and Struts.
I have a java client in struts that calls a web services.
The "ID" field contains a Java integer.
The "First_Name" is a Java String.
The "Effective_Date" field is a Java date field.
The web service returns an arrayList.
From the arrayList, I displayed the result as the following:

IDFIRST_NAMEEFFECTIVE_DATE
------------------------
3John9/10/2007
2Andrew1/11/2006
5Peter3/4/2006

The "ID" header is a link.
The "First Name" header is a link.
The "EFFECTIVE_Date" is a link.

If I clicked on the link "ID", the first time, it will sort the rows in ascending
order like the following:

IDFIRST_NAMEEFFECTIVE_DATE
------------------------
2Andrew1/11/2006
3John9/10/2007
5Peter3/4/2006

If I clicked on the link "ID", the second time, it will sort the rows in descending
order like the following:
IDFIRST_NAMEEFFECTIVE_DATE
------------------------
5Peter3/4/2006
3John9/10/2007
2Andrew1/11/2006

If I clicked on the "First_Name" field the first time, it will sort the rows in
desceding order.
If I clicked on the "First_Name" field the second time, it will sort the rows in
ascending order.

This applies the same for the "EFFECTIVE_DATE".

Any hint would be greatly appreciate.

Yours,

Frustrated.
 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well what you can do is pass out the current page number and the user has to pass back the received page number in soap body. More so analogous to the session ID as in HTTP communication.
This can easily be done by modifying the service that you are exposing to take in one more parameter called the pageNumber which the clinet has to pass and hurray your worries are gone


Alternative approach I think can be that of using the headers for passing the pagenumber. May be you can write handlers on your side and the client will have to do that on his side.

But I guess this would be a complicated matter.
 
You would be much easier to understand if you took that bucket off of your head. And that goes for the tiny ad too!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic