140 Difference between requestDispatcher forward and response sendRedirect methods | advance java

Описание к видео 140 Difference between requestDispatcher forward and response sendRedirect methods | advance java

#Servlet #interview #question: What is the #difference #between #reqeustDispatcher.#forward(-,-) and #response.#sendRedirect(-) method? (Servlet Chaining/ Servlet to servlet communication) advance java servlet programming tutorial

reqeustDispatcher.forward response.sendRedirect
----------------------------- -------------------------------
1)Given to perform forwarding 1)Given to perform send
request mode of servlet redirection mode of servlet
chaining. chaining.

2)Source Servlet program 2)Source program interacts with
interacts with destination destination program by having
program directly network round trip with browser
window.

3)Source and destination 3)Source program and destination
programs will use same program will not use same request
request and response object and response objects so request
so request data coming to data coming to source program is
source program is visible not visible and accessible to
and accessible in destination destination program directly.
program.

4)To pass additional data 4)To pass additional data from
from source program to source program to destination
destination program we have program, we need to append query
to use requst attributes. string to the URL of response.sendRedirect(-) method.

5)Source and destination pgm 5)Source and destination program
can be there in same web can be there in same web applic
application or can be there ation or two differnt web applic
in two different web applicat ations or Different servers.
ion(Works only with Weblogic
server)

6)Destination program must be 6)Destination program can be
Java Webapplication Compatiable any technology program including
ASP, ASP.Net, PHP, Servlet & etc.
7)During this servlet chaining 7)During the servlet chaining
URL in browser address bars URL in browser address bar wiil
will not be change. will be change.

8) Useful when source and 8)Useful when source and
destination programs are destination programs are local
local to each others. as well as remote to each others.

Комментарии

Информация по комментариям в разработке