Complex structure in JSTL

Discussion in 'Java' started by Johnny, Mar 14, 2006.

  1. Johnny

    Johnny Guest

    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("sessionid"));
    sessionInfoBean.setRowNumber(Long.toString(rs.getLong("row_number")));
    sessionInfoBean.setRowRecord(rs.getString("rowrecord"));
    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!
     
    Johnny, Mar 14, 2006
    #1
    1. Advertising

  2. Johnny

    Guest

    , Mar 14, 2006
    #2
    1. Advertising

  3. Johnny

    Johnny Guest

    Johnny, Mar 15, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. news.amnet.net.au
    Replies:
    1
    Views:
    588
    =?UTF-8?b?TMSByrtpZSBUZWNoaWU=?=
    Apr 13, 2004
  2. Robert Mark Bram

    Custom JSTL that accepts JSTL expression

    Robert Mark Bram, Dec 15, 2004, in forum: Java
    Replies:
    0
    Views:
    982
    Robert Mark Bram
    Dec 15, 2004
  3. Stanimir Stamenkov
    Replies:
    2
    Views:
    763
    Stanimir Stamenkov
    Oct 25, 2005
  4. Robert Mark Bram
    Replies:
    0
    Views:
    700
    Robert Mark Bram
    Feb 4, 2007
  5. DaFoot
    Replies:
    1
    Views:
    1,717
    DaFoot
    Oct 23, 2008
Loading...

Share This Page