SpringMVC重定向与转发
发布日期:2021-05-06 18:58:37 浏览次数:22 分类:精选文章

本文共 312 字,大约阅读时间需要 1 分钟。

重定向 , 不需要视图解析器 , 本质就是重新请求一个新地方嘛 , 所以注意路径问题.

@Controllerpublic class ResultSpringMVC2 {   	@RequestMapping("/rsm2/t1")	public String test1(){   		//转发		return "test";	}		@RequestMapping("/rsm2/t2")	public String test2(){   		//重定向		return "redirect:/index.jsp";		//return "redirect:hello.do"; //hello.do为另一个请求/	}}
上一篇:SpringMVC数据处理
下一篇:RestFul 风格

发表评论

最新留言

很好
[***.229.124.182]2025年04月16日 19时50分42秒