,
Share with your friends 

basic servlet method ouestion........

7 ratings Views 239 
Author: GEET (GEET KALANI)  View Profile |  View other solutions by this author

Question / Problem


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

Solution

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.



Applies to

Servlet

Rank It

Login to rank it

Report


Advertisement