Hi, I am doing a project in pure JSP, Servlet, Hibernate and MySQL. I am using jsp for a presentation and Servlet for buiseness logic.
In my one jsp form there is one combobx and other textboxes are present.
My problem is that, I want to fill that combobox from the database table value.But i cant understand how it is possible by using setter/getter method.
My .jsp code snippet is....
<select name="wardNameCB" size="1" >
<option value="" selected>Select</option>
<%Iterator itr;%>
<% List wList= (List)request.getAttribute("wList");
for (itr=wList.iterator(); itr.hasNext(); )
{
String value=(String)itr.next();
%>
<option value=<%=value %>><%=value %></option>
<%} %>
</select>
My Servlet is.......
else if(act.equalsIgnoreCase("getAllWardList")) {
log.info("inside getAllWardList Action");
WardBo wrdbo = new WardBo();
List wardList = wrdbo.getAllWardList(1);
[B]List wList = new ArrayList();[/B]
[B]wList = wrdbo.getAllWardList();
request.setAttribute("wList",wList);[/B]
request.setAttribute("nextPageNumber", 2);
request.setAttribute("previousPageNumber", 1);
request.setAttribute("wardList", wardList);
getServletContext().getRequestDispatcher("/WardSetup.jsp").forward(request, response);
}
Plz help me its urgent.......