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 request dispatcher and how does it work?

Answer Posted / mahesh bolla

Request dispatcher is used to transfer the same rquest to
another page/servlet without user interaction.
Exampe:
Suppose we have 2 servlets.
Write the below code in first Servlet

----
----
RequestDispatchet rd = request.getRequestDispatcher
("/secondServlet");
rd.forward(request, response);
//or rd.include(request, response);

---
----
Similar thing can be done in JSPs also

Write the below code in one.jsp

<js:forward page="two.jsp"/>
or
<jsp:include page="two.jsp");

If we use "forwad" then request will transfered to the
second page but not returned back to first page. We can see
only the second page's output.

If we use "include" then the sencond page itself will be
included in the first page. Then the output is the
combination of both the pages.

Is This Answer Correct ?    34 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain about static nested classes in java?

1112


Write a method that will remove given character from the string?

1082


Why we use protected in java?

1022


In the below example, how many string objects are created?

1094


Write a program to check for a prime number in java?

1089


What is meant by oops concept in java?

1050


What are 3 data types?

1036


What about method local inner classes or local inner classes in java?

1104


How are variables stored?

1031


What is the flag in java?

1110


Which collection allows duplicate values in java?

1024


How do you add an element to a set in java?

1079


What is better- service oriented or batch oriented solutions?

2295


What is namespace in java?

1060


What are extraneous variables examples?

1169