<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.
    主站蜘蛛池模板: 免费观看亚洲人成网站| 国产亚洲精品AAAA片APP| 在线看片免费人成视频播| 亚洲国产精品不卡毛片a在线| 亚洲AV无码精品国产成人| 国产无遮挡吃胸膜奶免费看视频| 亚洲人成网站18禁止| 日韩在线天堂免费观看| 无码色偷偷亚洲国内自拍| 免费日本黄色网址| 一区二区三区免费在线视频| 中文字幕亚洲一区二区va在线| 在线免费观看伊人三级电影| 亚洲一区影音先锋色资源| 免费无码黄十八禁网站在线观看 | 手机看片久久国产免费| 国产精品亚洲二区在线| 亚洲男人av香蕉爽爽爽爽| CAOPORN国产精品免费视频| 亚洲va在线va天堂va888www| aⅴ在线免费观看| 亚洲色大成网站www永久男同| 亚洲第一区精品观看| 国产精品免费大片| 亚洲精品福利你懂| 亚洲AV无码乱码在线观看| 精品免费tv久久久久久久| 亚洲午夜精品在线| 亚洲A丁香五香天堂网| 日韩精品免费视频| 亚洲欧美日韩综合久久久| 亚洲国产精品13p| 亚洲成人在线免费观看| 免费无码又爽又黄又刺激网站 | jizzjizz亚洲| 无码人妻丰满熟妇区免费| 亚洲色欲色欱wwW在线| 久久精品国产亚洲AV不卡| 可以免费看黄的网站| 亚洲一区二区三区免费| 精品亚洲AV无码一区二区三区|