J
Johnny
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!
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!