<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    引言
    在使用response的過程中經常會遇到跳轉頁面的事情,這個時候有兩種情況供你選擇
    1。就是調用
    ServletContext.getRequestDispatcher(java.lang.String).forward(request ,
    response) ;
    2。就是調用response.setRedirect(),可是這兩個方法有什么不同呢?


    看看TSS上關于這個問題的解釋:
    Difference request.forward() and response.sendRedirect .
    Posted by: Kapil Israni on August 24, 2000 in response to Message #2253 1
    replies in this thread
    i suppose u r talking bout requestDispatcher.forward() here.

    well basically both method calls redirect u to new resource/page/servlet.

    the difference between the two is that sendRedirect always sends a header
    back to the client/browser. this header then contains the
    resource(page/servlet) which u wanted to be redirected. the browser uses
    this header to make another fresh request. thus sendRedirect has a overhead
    as to the extra remort trip being incurred. its like any other Http request
    being generated by ur browser. the advantage is that u can point to any
    resource(whether on the same domain or some other domain). for eg if
    sendRedirect was called at www.mydomain.com then it can also be used to
    redirect a call to a resource on www.theserverside.com.

    where as in case of forward() call, the above is not true. resources from
    the server, where the fwd. call was made, can only be requested for. but
    the major diff between the two is that forward just routes the request to
    the new resources which u specify in ur forward call. that means this route
    is made by the servlet engine at the server level only. no headers r sent
    to the browser which makes this very eficient. also the request and
    response objects remain the same both from where the forward call was made
    and the resource which was called.

    i hope i have hit ur question right.
    主站蜘蛛池模板: 国产高清视频免费在线观看| 国内精品久久久久影院免费| 美女视频黄免费亚洲| 久久久久无码精品亚洲日韩| 在线播放免费人成视频网站 | 亚洲精品狼友在线播放| 又硬又粗又长又爽免费看| 中文字幕亚洲综合久久菠萝蜜| 一级人做人爰a全过程免费视频| 亚洲天堂中文字幕在线| 国产精品hd免费观看| 亚洲国产另类久久久精品小说| 青青草原1769久久免费播放| 亚洲欧洲日韩国产综合在线二区| 99视频在线看观免费| 亚洲香蕉在线观看| 免费无码一区二区三区蜜桃大| 亚洲七久久之综合七久久| 国产成人免费片在线视频观看| 一级毛片**免费看试看20分钟| 亚洲乱码无码永久不卡在线| 无码午夜成人1000部免费视频| 亚洲免费在线视频观看| 日本特黄特色aa大片免费| 无码毛片一区二区三区视频免费播放| 国产亚洲精品成人AA片新蒲金| 99热在线观看免费| 亚洲精品456人成在线| 亚洲成片观看四虎永久| 一级特黄aa毛片免费观看| 日韩亚洲国产综合高清| 国产乱辈通伦影片在线播放亚洲 | 成人免费在线视频| 国产成人精品免费视频大全| 久久亚洲熟女cc98cm| 日韩成人在线免费视频| 久久久精品免费国产四虎| 亚洲精品色播一区二区| 亚洲综合色自拍一区| 免费人成视频在线| 巨胸喷奶水视频www免费视频|