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 comment?

535


What is java servlet container?

512


What is urn?

529


What is archiving?

557


What is java api for xml registries (jaxr)?

547






What is j2ee server?

553


What is instance in java?

496


What is commit?

642


What is the container?

567


What is considered as a web component?

562


What software is needed for java programming?

460


What does java ee stand for?

447


Enlist the technologies embraced in j2ee?

529


What are the four components of j2ee application?

564


What is the mvc on struts?

514