1.如果类上加了 @RequestMappin注解,那么就会去该注解对应的路径下去找页面,如果没有对应的页面就会报错。
举例说明:
@RequestMapping("/user")
public class UserController {
@RequestMapping("/requestParam51")
public String requestParam51(String[] name) {
return "index.jsp";
}
}
对应的跳转页面会去user目录下去找,找不到就会报错。
2.如果类上没有加@RequestMapping注解,就会直接去根路径下去找页面
3.如果为跳转的页面加了"/",还是会去根路径下去找对应的页面。
举例:
@RequestMapping("/user")
public class UserController {
@RequestMapping("/requestParam51")
public String requestParam51(String[] name) {
return "/index.jsp";
}
}



