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...

Difference between Include, Forward and sendRedirect in
Servlet?

Answer Posted / md.farookh.mb

Response.sendRedirect () This function is used, when we
want to redirect
the client request to some other site (i.e out of our
context) or
when ever we want to redirect errors. If you are using
sendRedirect (), then it will be visible to the client that
means the URL which you have been redirected will be
visible in the address bar. Redirect response to the client
using the specified redirect location URL.

RequestDispatcher Interface:
Forward() : This can be done in two ways by Request &
ServeletContext.
Forwarding a request from a servlet to another resource
(servlet, JSP
file, or HTML file) on the server. Forward is done at
server side, without the client's knowledge.

When you invoke a forward request, the request is sent to
another
resource on the server, without the client being informed
that a
different resource is going to process the request. This
process occurs
completely with in the web container. When a sendRedirtect
method is
invoked, it causes the web container to 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.
Include:Includes dynamic page information..

Is This Answer Correct ?    130 Yes 15 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the advantages of cookies?

1078


Which httpsession object is used to view and manipulate information about a session?

1121


how the HTML data stored in web server?

2571


What is meant by a web application

980


How do you define a servlet?

949


Explains the differences between context.getrequestdispatcher() and request.getrequestdispatcher()?

976


How to get the current httpsession object?

1087


Tell us something about servletconfig interface.

960


How httpservlet is different from the genericservlet?

1088


What is servletconfig?

988


What is a web application and what is it’s directory structure?

1043


What is the life cycle of a servlet?

1452


How do you find out what client machine is making a request to your servlet

1027


What is the use of request dispatcher interface?

980


What is the functionality of actionservlet and requestprocessor?

1048