A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
Win a copy of
The Mikado Method
this week in the
Agile and other Processes
forum!
JavaRanch
»
Java Forums
»
Java
»
Web Services
Author
Collection manipulation
AshishP Gandhi
Greenhorn
Joined: Aug 05, 2007
Posts: 9
posted
Aug 09, 2007 00:26:00
0
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.
Regards,
Ashish.
Ronald Aguilar
Greenhorn
Joined: Sep 14, 2004
Posts: 21
posted
Aug 21, 2007 07:39:00
0
try a
JSF
dataScroller. it will take you 5 minute to implement.
Ron
Suryavas.k Kazipeta
Greenhorn
Joined: Nov 24, 2008
Posts: 3
posted
Nov 24, 2008 22:16:00
0
Hi,
Implementing
java.util.Collections
is possible in WebServices using @XmlJavaTypeAdapter (JAXB 2.0).
have a look on below link and example
https://jaxb.dev.java.net/guide/XML_layout_and_in_memory_data_layout.html
@XmlRootElement
class ComplexStruct {
@XmlJavaTypeAdapter(value=ArrayListDataAdapter.class)
@XmlElement
ArrayList
<Data> dataList;
}
class ArrayListDataAdapter extends
XmlAdapter
<Data[],
ArrayList
<Data>> {
@Override
public
ArrayList
<Data> unmarshal(Data[] objectArray2ArrayList) {
if ( objectArray2ArrayList == null )
return null;
return new
ArrayList
<Data>(Arrays.asList(objectArray2ArrayList));
}
@Override
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;
}
}
regards,
Surya.
I agree. Here's the link:
http://ej-technologies/jprofiler
- if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
subject: Collection manipulation
Similar Threads
Collections / Generics
Collection manipulation
Records In Collection Object
B&S:On the class Data
I do not know
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter