I am making my db queries in a helper class(AccountService) and sending the storing the data in an arraylist. I send the arraylist back to the action file.
Snippet from helper file
ArrayList accountsList = new ArrayList();
while( rs.next() )
{
acc = new AccountDO();
acc.setAccountname(rs.getString(1));
acc.setAccountowner(rs.getString(2));
accountsList.add(acc);
}Snippet from the action file
ArrayList accountsList = null;
try
{
ServletContext servletContext = servlet.getServletContext();
DataSource dataSource = (DataSource)servletContext.getAttribute(Action.DATA_SOURCE_KEY);
Connection conn = dataSource.getConnection();
Statement stmt = conn.createStatement();
AccountService account = new AccountService(conn, stmt, session, dataBaseName);
accountsList = account.retreiveAccount();
}
But , when I try to retrieve the data in my jsp, I always get the
"Cannot find bean accountsList in any scope" exception.
This is what I have in my jsp code
<logic:iterate id="acc" name="accountsList"> <tr align="left"> <td> <bean:write name="acc" property="accountname" /> </td> <td> <bean:write name="acc" property="accountowner" /> </td> </tr> </logic:iterate>
Any help appreciated.
TIA Richie
"To achieve all that is possible, one must attempt the impossible"

