Hi All,
I have been following the trail in the list regarding RequestDispatcher and
sendredirect. From, my own experience and from the trail I gather the
following five differences.
Kindly correct me if I am wrong and add if there are any more differences !
I will start from the simplest and most basic :
1. sendRedirect (String) is a method of the HttpServletResponse Interface.
RequestDispatcher is an Interface with two methods forward(request,
response) and include (request,response)
2. The parameter passed to sendRedirect has to be absolute path of the
"target servlet". The parameters passed to the RequestDispatcher mehtods are
request and response. The parameter to be passes to the ServletContext to
get the RequestDispatcher object is the URL of the "target servlet". This
URL need not be absolute.
3. When using sendRedirect, we can not pass the Request object to the target
servlet / jsp.
4. When using sendRedirect, we can not set response headers. I do not know
if we can set response headers in the first servlet before calling
RequestDispatcher object and doing a forward.
Thanks in advance,
Bhaskar Varanasi
IIC Technologies Pvt. Ltd.,
Hyderabad.
http://www.iictechnologies.com
Alternate e-mail :
[EMAIL PROTECTED]
[EMAIL PROTECTED]
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html