您好,欢迎来到[编程问答]网站首页   源码下载   电子书籍   软件下载   专题
当前位置:首页 >> 编程问答 >> Web开发 >> springMVC使用ModelAndView"/indexjsp"返回路径问题

springMVC使用ModelAndView"/indexjsp"返回路径问题

来源:网络整理     时间:2016/5/31 11:42:26     关键词:modelandview,springmvc

关于网友提出的“springMVC使用ModelAndView"/indexjsp"返回路径问题”问题疑问,本网通过在网上对“springMVC使用ModelAndView"/indexjsp"返回路径问题”有关的相关答案进行了整理,供用户进行参考,详细问题解答如下:

问题:springMVC使用ModelAndView"/indexjsp"返回路径问题
描述:

springMVCModelAndViewspring mvc

大家好,有个springMVC问题请教下:
表单:

提交后进入到controller:
 @RequestMapping("student/findStudents.do")
    public String findStudents(){
        ...
        return "/index";  //这种方法可以正常返回到index.jsp页面
    }
但是用下面的方法路径不对:
 @RequestMapping("student/findStudents.do")
    public ModelAndView findStudents(){
        ModelAndView mav = new ModelAndView("/index");
        return mav;  
  }
为什么返回路径不是构造函数的参数指定的路径,而是请求路径:student/student/findStudents2
以上介绍了“springMVC使用ModelAndView"/indexjsp"返回路径问题”的问题解答,希望对有需要的网友有所帮助。
本文网址链接:http://www.codes51.com/itwd/1432759.html

相关图片

相关文章