日期:2014-05-16  浏览次数:21335 次

再将struts1改为struts2的时候,这个为题该怎么处理呢
Java code
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");
    }
    


这里面用了request,难道在用struts2的时候,这种情况也要用request吗

------解决方案--------------------
网上查