Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is difference between Forward() and sendRedirect()
methode?

Answer Posted / shakir khan

The RequestDispatcher forward and include methods are
internal to a servlet container and does not affect the
public url of the webresource.

forward() are excute on the server side.

when a forward() is invoked,the request is sent to another
resource on the server without the client being inform that
a different resource is going to process the request.This
occurs completely with in the webcontainer.

sendRedirect() excutes on the client side.

When a sendRedirect()is invoked,it causes the webcontainer
return to the browser,indicating that a new url should be
requested because the browser issues a completely new
request,any object that are stored as request attributes
before the redirect occurs will be lost.
This extra round trip,a redirect is slower than forward.

Is This Answer Correct ?    45 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Define the lifecycle for executing a jsp page.

1085


How can we include static files in the jsp page?

1064


What is the functionality of actionservlet and requestprocessor?

1090


What do you mean by the servlet chaining?

1085


What is the servletconfig object?

1045


Which method of the httpservletrequest object is used?

1096


When a client request is sent to the servlet container, how does the container choose which servlet to invoke?

1029


Explain servlet.

1047


Why is http protocol called as a stateless protocol?

1034


Which exception is thrown if the servlet is not initialized properly?

1028


What is webservlet?

997


Why is a constructor needed in a servlet even if we use the init method?

1140


How to get the actual path of servlet in server?

1225


What is a generic servlet?

958


What is new in ServletRequest interface ? (Servlet 2.4)

1016