Link to home
Start Free TrialLog in
Avatar of gudii9
gudii9Flag for United States of America

asked on

servlet sendRedirect

Hi,

I am reading about servlet sendRedirect as below

http://www.javatpoint.com/sendRedirect%28%29-method

orward() method      sendRedirect() method
The forward() method works at server side.      The sendRedirect() method works at client side.
It sends the same request and response objects to another servlet.      It always sends a new request.
It can work within the server only.      It can be used within and outside the server.
Example: request.getRequestDispacher("servlet2").forward(request,response);      Example: response.sendRedirect("servlet2");


I ran this example by creating fresh dynamic web project and copying src and web.xml, index.html files.
I redirected to google page as below

https://www.google.co.in/#q=sai

what is meaing of '#q '


I have not clearly understood the differences between redirect, forward.Advantages, disadvantage, practical uses of each of them.



please advise
Any links resources ideas highly appreciated. Thanks in advance
ASKER CERTIFIED SOLUTION
Avatar of mccarl
mccarl
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial