display the data using logic:iterate retrieve from db


Web tier: servlets, JSP, Web frameworks: display the data using logic:iterate retrieve from db

  1. display the data using logic:iterate retrieve from db (2 messages)

    i am using struts.i am getting the data from database and storing into a list ,then setting in to the request. From jsp i want iterate and display in my page.But the problem is no data displaying. below i attcahed the code.. in action class: public ActionForward execute(ActionMapping mapping,ActionForm form, HttpServletRequest request,HttpServletResponse response) throws DataAccessException,GeneralException{ System.out.println("In ListStaffCommand method"); StaffContext staffForm = (StaffContext)form; ActionForward forward = null; staffservice.showStaffList(request); forward = mapping.findForward("showliststaff"); return forward; } ---------------------------------------------------------- service class has: public HttpServletRequest showStaffList(HttpServletRequest request) throws GeneralException { List stafflist = staffDAO.showStaffList(); if (stafflist != null && stafflist.size() > 0) { request.setAttribute("stafflist", stafflist); } else { throw new GeneralException("No Police Stations"); } return request; } ------------------------------------------------------ DAO class has: DAO dao = new DAO(); DAOParameter params = new DAOParameter(); public List showStaffList() throws DataBaseException { List list = dao.executeQuery("showStaffList", params, "com.cipa.to.StaffTO"); return list; } ----------------------------------------- jsp has: -------------------------------------------- please do reply if anybody knows the solution. regards Subhashree
  2. See examples here: http://www.servletsuite.com/servlets/datalist.htm
  3. thanks, i got it. regards Subhashree