springMVC学习 六 跳转方式

SpringMVC的controller中的方法执行完之后,默认的跳转方式是请求转发

如果想要修改跳转方式,可以设置返回值字符串内容
(1) 添加 redirect:资源路径 重定向 "redirect:/main.jsp"
(2)添加 forward:资源路径 或省略 forward: 转发  "forward:/main.jsp"

原文地址:https://www.cnblogs.com/cplinux/p/9786631.html