jQuery in Action, 3rd edition
The moose likes Web Services and the fly likes Collection manipulation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Collection manipulation" Watch "Collection manipulation" New topic

Collection manipulation

AshishP Gandhi

Joined: Aug 05, 2007
Posts: 9
I need to take some records and display it on a jsp...and manipulate them like sorting / pagination
These records come through webservice.

Can you guide how should I go about it?

Can I make a class and get all data in collection and manipulate it the class when jsp page asks for sorting which is a button?

Awaiting replies.

Ronald Aguilar

Joined: Sep 14, 2004
Posts: 21
try a JSF dataScroller. it will take you 5 minute to implement.

Suryavas.k Kazipeta

Joined: Nov 24, 2008
Posts: 3

Implementing java.util.Collections is possible in WebServices using @XmlJavaTypeAdapter (JAXB 2.0).
have a look on below link and example

class ComplexStruct {
ArrayList<Data> dataList;

class ArrayListDataAdapter extends XmlAdapter<Data[], ArrayList<Data>> {

public ArrayList<Data> unmarshal(Data[] objectArray2ArrayList) {
if ( objectArray2ArrayList == null )
return null;

return new ArrayList<Data>(Arrays.asList(objectArray2ArrayList));
public Data[] marshal(ArrayList<Data> arrayList2ObjectArray) {
if ( arrayList2ObjectArray == null )
return null;

Data[] dataArray = new Data[ arrayList2ObjectArray.size() ];
int i=0;
for (Data data : arrayList2ObjectArray) {
dataArray [ i++ ] = data;
return dataArray;

I agree. Here's the link: http://aspose.com/file-tools
subject: Collection manipulation
jQuery in Action, 3rd edition