Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Complex structure in JSTL

Thread Tools

Complex structure in JSTL

Posts: n/a
Hello everyone,

I have a difficult question about JSTL.

I have following strutures in my WebApp but I don't know how to
reterieve data from it using JSTL.

So first, I have a container class for data. Code snippet is below.
It contains different objects stored by key value.

public class UserResponse extends Hashtable
public UserResponse(){

// Getter
public Object getResponse(String key) {
return get(key);
// Setter
public void setResponse(String key, Object value) {
put(key, value);

Then I have a ordinary SessionBean like this
public class SessionInfoBean implements
private String SessionID;
private String RowRecord;
private String RowNumber;
and I read them from database and store them into an ArrayList.
like this way

ArrayList SessionsList = new ArrayList();
while (
SessionInfoBean sessionInfoBean = new SessionInfoBean();
sessionInfoBean.setSessionID(rs.getString("session id"));
sessionInfoBean.setRowNumber(Long.toString(rs.getL ong("row_number")));
sessionInfoBean.setRowRecord(rs.getString("rowreco rd"));

Then I store the ArrayList of SessionInfoBean intems into UserResponse
object that is descripted in the beginning this message. Code look like

userResponse.setResponse(Constants.DATA_BY_ID, (Object) SessionsList);

The question is: Can I iterate all properties that are in ArrayList stored
into SessionInfoBean items using JSTL?

Is this too complex or can it be resolved?


Reply With Quote
Posts: n/a
It is very easy to iterate though a collection in JSTL. This link has
all the details you need.

Reply With Quote
Posts: n/a
Thanks, this document seems to very clear.

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)
> It is very easy to iterate though a collection in JSTL. This link has
> all the details you need.

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
(struts/JSTL) Setting bean property value with jstl choose compoundresults DaFoot Java 1 10-23-2008 12:42 PM
wsdl2java: method parameter a complex type that extends another complex type Robert Mark Bram Java 0 02-04-2007 10:06 AM
[XML Schema] Content type of complex type definition with complex content Stanimir Stamenkov XML 2 10-25-2005 10:16 AM
Custom JSTL that accepts JSTL expression Robert Mark Bram Java 0 12-15-2004 12:26 AM
For expert on complex loops (reposted) - complex looping problem Java 1 04-13-2004 07:10 AM