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

Explain j2ee architecture.

779


What is meant by applet in java?

700


What is javabeans component?

701


Why do we use j2ee?

643


What does the web module contain?

736


What is ejb container provider?

629


Is java more difficult than c++?

662


What is application client?

737


What is java naming and directory service?

711


What is java api for xml processing (jaxp)?

737


What is home handle?

712


What is core java and j2ee?

672


What is advance java?

669


What is Connector architecture?

706


What is java 2 platform, micro edition (j2me)?

711