springmvc跳转页面并传值_JAVA_编程开发_程序员俱乐部

中国优秀的程序员网站程序员频道CXYCLUB技术地图
热搜:
更多>>
 
您所在的位置: 程序员俱乐部 > 编程开发 > JAVA > springmvc跳转页面并传值

springmvc跳转页面并传值

 2014/4/1 18:28:15  shibin_1109  程序员俱乐部  我要评论(0)
  • 摘要:@ControllerpublicclassListMobilecardsController{@RequestMapping(value="/listMobilecards.action",method=RequestMethod.GET)publicModelAndViewlistMobilecardsAction(@RequestParam(value="curPage",required=false)LongcurPage)
  • 标签:MVC Spring
class="java" name="code">
@Controller  
public class ListMobilecardsController  
{  
    @RequestMapping(value = "/listMobilecards.action", method = RequestMethod.GET)  
    public ModelAndView listMobilecardsAction(@RequestParam(value = "curPage", required = false)  
    Long curPage)  
    {  
        ModelAndView modelAndView = new ModelAndView("mobilecard/listMobilecards");  
  
        if (null == curPage)  
        {  
            curPage = 1l;  
        }  
  
        Pager pager = new Pager();  
        pager.setCurPage(curPage);  
  
        MobilecardService mobilecardService = (MobilecardService) BSSBeanFactory.getBean(MobilecardService.BEAN_NAME);  
        mobilecardService.findMobilecardsByPager(pager);  
  
        modelAndView.addObject("pager", pager);  
  
        return modelAndView;  
    }  
}  


public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse           response) throws Exception {
   ........
   response.sendRedirect("photohouxuandetail.do?pid="+pid);
   return null;
}


   return new ModelAndView("redirect:photohouxuandetail.do?pid="+pid);
发表评论
用户名: 匿名