日期:2014-05-16 浏览次数:21335 次
public ActionForward browseIndexMer(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { List cateList = null; List merList = null; List smerList = null; MerService service = new MerServiceImpl(); int paseSize = 3; //一页包含3条记录 int pageNo = 1; //当前为第一页 try{ cateList = service.browseCategory(); merList = service.browseMer(paseSize,pageNo,0,false); smerList = service.browseMer(paseSize,pageNo,0,true); if (cateList!=null)request.setAttribute("cateList", cateList); if (merList!=null)request.setAttribute("merList", merList); if (smerList!=null)request.setAttribute("smerList", smerList); }catch(Exception ex){ logger.info("在执行MerAction类中的browseIndexMer方法时出错:\n"); ex.printStackTrace(); } return mapping.findForward("index"); }