Saturday, March 14, 2009

What?s the difference between sendRedirect( ) and forward( )

Question :What?s the difference between sendRedirect( ) and forward( )
methods? (Servlets)


Answer :A sendRedirect method creates a new request (it?s also reflected in
browser?s URL ) where as forward method forwards the same request to
the new target(hence the chnge is NOT reflected in browser?s URL).
The previous request scope objects are no longer available after a redirect
because it results in a new request, but it?s available in forward.
SendRedirectis slower compared to forward.

1 comments:

  1. Hi

    Tks very much for post:

    I like it and hope that you continue posting.

    Let me show other source that may be good for community.

    Source: Job interview questions

    Best rgs
    David

    ReplyDelete

Your Ad Here