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?

Answers were Sorted based on User's Feedback



what is request dispatcher and how does it work?..

Answer / 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

what is request dispatcher and how does it work?..

Answer / sonal

yes its totaly right ...

Is This Answer Correct ?    9 Yes 1 No

Post New Answer

More Core Java Interview Questions

What is double word?

0 Answers  


What is OOP?

2 Answers   BMC, Microsoft,


what is the output??????? public class multireturn { public(int assign x ( int x) { if(4==x) { return 7; } else if (7=x+3) { return 6; } return 5; } }

3 Answers   TCS,


What is the order of method invocation in an Applet?

1 Answers  


Can we use synchronized block for primitives?

0 Answers  


How to create an instance of a class without using "new" operator? Plz help me out properly.Thank u.

10 Answers   CSC,


Is empty .java file name a valid source file name?

0 Answers  


What is the purpose of having the concept of overloading?

7 Answers   Ness Technologies,


What is the original name of java?

0 Answers  


What does nullpointerexception mean?

0 Answers  


why java does not support unsigned keyword?

1 Answers  


What are the advantages of defining packages in java?

0 Answers  


Categories