请求转发和重定向的区别:
请求重定向和请求转发都是web开发中资源跳转的方式。
请求转发是服务器内部的跳转
地址栏不发生变化
只有一个请求响应
可以通过request域传递数据
请求重定向是浏览器自动发起对跳转目标的请求
地址栏会发生变化
两次请求响应
无法通过request域传递对象
SpringMVC中实现转发和重定向
1.在springMVC中仍然可以使用传统方式实现和转发重定向
2.在SpringMVC中也提供了快捷方法实现转发和重定向
只要在返回视图时,使用如下方式指定即可:
3.可以利用转发 实现允许用户访问WEB-INF下保护的指定资源