I have an action class, in which i read values from DB. i want to display those values in jsp using <html:select> as a listbox.
1)i declared one arraylist called statuslist in my formbean
2)im setting those retrieved values in action class to this arraylist like this.
fmActionForm = new FileManagementActionForm();
status = rs.getString("status");
3)in jsp, i try to display using <html:select> like this
<html:select property="selectedstatus" styleClass="select">
<html:options collection="statuslist" labelProperty="status" property="status"/>
i didnt use any session object to set and get in jsp for the arraylist.
Im getting error as: javax.servlet.ServletException: javax.servlet.jsp.JspException: Cannot find bean under name statuslist
in while loop. If i do so, the arraylist is storing only the last value when displaying in jsp.
my another doubt is, do i need to use session object to set arraylist in action class ? bcuz i use the following code to set arraylist in session. if i didnt put that in session, i couldnt get arraylist in jsp. it is throwing null pointer exception. any solution without session objects?
here is my code to set arraylist in session, in my action class