springMVC使用ModelAndView("/index.jsp")返回路径问题
乱世丶桃花 2015-06-16 02:53:10 大家好,有个springMVC问题请教下:
表单:
<form action="/student/findStudents.do" method="post">
提交后进入到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