<logic:forward>与<logic:redirect>区别
2012-12-07 15:00
381 查看
1 .<logic:forward>属于程序内部访问,一次请求
http://localhost:9999/strutsdemo
2 .<logic:redirect>重定向,发生两次请求 http://localhost:9999/strutsdemo/RegUserUI.htm
<global-forwards>
<forward name="reguserui" path="/RegUserUI.htm"></forward>
</global-forwards>
1. index.jsp中包含<logic:forward name="reguserui"/>时,IE地址显示的是http://localhost:9999/strutsdemo,
forward="reguserui"在index.jsp中没有找到最终画面,但直接转发给了RegUserUI.htm,访问成功
2. index.jsp中包含<logic:redirect forward="reguserui"/>时,IE地址显示的是http://localhost:9999/strutsdemo/RegUserUI.htm, forward="reguserui"在index.jsp中没有找到最终画面,所以再一次请求RegUserUI.htm,访问成功。
<logic:redirect page="/RegUserUI.htm"/>
http://localhost:9999/strutsdemo/RegUserUI.htm
<logic:redirect href="/strutsdemo/RegUserUI.htm"/>
http://localhost:9999/strutsdemo/RegUserUI.htm
http://localhost:9999/strutsdemo
2 .<logic:redirect>重定向,发生两次请求 http://localhost:9999/strutsdemo/RegUserUI.htm
<global-forwards>
<forward name="reguserui" path="/RegUserUI.htm"></forward>
</global-forwards>
1. index.jsp中包含<logic:forward name="reguserui"/>时,IE地址显示的是http://localhost:9999/strutsdemo,
forward="reguserui"在index.jsp中没有找到最终画面,但直接转发给了RegUserUI.htm,访问成功
2. index.jsp中包含<logic:redirect forward="reguserui"/>时,IE地址显示的是http://localhost:9999/strutsdemo/RegUserUI.htm, forward="reguserui"在index.jsp中没有找到最终画面,所以再一次请求RegUserUI.htm,访问成功。
<logic:redirect page="/RegUserUI.htm"/>
http://localhost:9999/strutsdemo/RegUserUI.htm
<logic:redirect href="/strutsdemo/RegUserUI.htm"/>
http://localhost:9999/strutsdemo/RegUserUI.htm
相关文章推荐
- <jsp:forward>与response.sendRedirect的区别
- <jsp:forward>与response.sendRedirect()的区别
- 指定したURLにリダイレクトする<logic:redirect>
- <context-param>与<init-param>的区别与作用
- <iostream> 和 <iostream.h>的区别 及 Linux下编译iostream.h的方法
- <%@include file=""%>和 <jsp:include file="">之间的区别
- <%@ include file=""%>与<jsp:include page=""/>区别
- <%@ include file=""%>与<jsp:include page=""/>区别
- <string>与<string.h>以及<cstring>的区别
- <%%>与<scriptrunat=server>,<%=%>与<%#%>的区别
- <%@ include file=""%>与<jsp:include page=""/>区别
- <jsp:directive.page import=""/> 和<%@ page import="" %>的区别
- <iframe>和<frame>的区别是什么?
- 简述使用<iostream.h>与<iostream>命名空间std这两种形式有什么区别?
- <input>里name和id的区别
- <context-param>与<init-param>的区别与作用
- <button>标签与<form>标签对于创建按钮的区别
- <%#%>和 <%=%> 区别
- <jsp:include>和<jsp:forward>
- <%include file="a.jsp"%>与<jsp:include file="a.jsp"/>有什么区别?