Velocity Reviews - Computer Hardware Reviews

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

Reply
Thread Tools

Complex structure in JSTL

 
 
Johnny
Guest
Posts: n/a
 
      03-14-2006
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 java.io.Serializable
{
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 (rs.next())
{
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"));
SessionsList.add(sessionInfoBean);
}

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

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?

Thanks!


 
Reply With Quote
 
 
 
 
josh.s17@gmail.com
Guest
Posts: n/a
 
      03-14-2006
It is very easy to iterate though a collection in JSTL. This link has
all the details you need.

http://www-128.ibm.com/developerwork...ry/j-jstl0318/

 
Reply With Quote
 
 
 
 
Johnny
Guest
Posts: n/a
 
      03-15-2006
Thanks, this document seems to very clear.
Cheers!


<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
> It is very easy to iterate though a collection in JSTL. This link has
> all the details you need.
>
> http://www-128.ibm.com/developerwork...ry/j-jstl0318/
>



 
Reply With Quote
 
 
 
Reply

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 news.amnet.net.au Java 1 04-13-2004 07:10 AM



Advertisments