标签:war 独立 color and class pre cti jsp页面 ring
1. forward前缀:转发到一个页面或一个action
不会由我们配置的视图解析器拼串,独立解析,一定要加“/”,不加就是相对路径,容易出问题;
》转发到jsp页面:
@RequestMapping("/handle")
public String handle() {
return "forword:/index.jsp" ;
}
》转发到action:
@RequestMapping("/handle1")
public String handle1() {
return "forword:/msg" ;
}
@RequestMapping("/msg")
public String handle() {
return "forword:/index.jsp" ;
}
2. redirect前缀:重定向到一个页面或一个action
》重定向到jsp页面:
@RequestMapping("/handle")
public String handle() {
return "redirect:/index.jsp" ;
}
》重定向到action:
@RequestMapping("/handle1")
public String handle1() {
return "redirect:/msg" ;
}
@RequestMapping("/msg")
public String msg() {
return "redirect:/index.jsp" ;
}
标签:war 独立 color and class pre cti jsp页面 ring
原文地址:https://www.cnblogs.com/luliang888/p/11074889.html