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
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