What is the difference between sendRedirect() and forward()?
in what situations do we have to use send redirect()
instead of forward().

Answer Posted / aravind

forward() is a action element in jsp. it is used to pass
ctrl from current page to another jsp page and it is a
method in jsp.

send redirect() is a method in servlet.
there are two methods used. as
HttpServletResponse.encodeReDirctURL().which takes String
represents a redirction url.next sendredirect() method.
which takes the String returned from the
encoderedirectString() and send it back to the client for
redirection

Is This Answer Correct ?    8 Yes 10 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is external subset?

538


What is the best java application server?

470


What is application configuration resource file?

503


Why is java robust?

647


What is ejb jar file?

463






What is 'applet container' ?

614


What does application client module contain?

538


What is container-managed transaction?

571


What is j2ee tutorial?

498


Which java ide is best?

489


What id url?

514


What is the latest framework in java?

472


What are j2ee technologies?

450


What is java developer?

468


What is difference between java and core?

456