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 the source code for include() & forwrd() method
servlet program?



What is the source code for include() & forwrd() method servlet program?..

Answer / sunny

1. forward should be called before the response has been
committed to the client.

public class Dispatcher extends HttpServlet {
public void doGet(HttpServletRequest req,
HttpServletResponse res) {
RequestDispatcher dispatcher =
request.getRequestDispatcher
("/template.jsp");
if (dispatcher != null) dispatcher.forward
(request, response);
}
}

2. Includes the content of a resource (servlet, JSP page,
HTML file) in the response.

public class Dispatcher extends HttpServlet {
public void doGet(HttpServletRequest req,
HttpServletResponse res) {
RequestDispatcher dispatcher =
getServletContext
().getRequestDispatcher("/banner");
if (dispatcher != null) dispatcher.include
(request, response);
}
}

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More JavaScript Interview Questions

How to have the status line update when the mouse goes over a link (the support of the status line is sporadic)?

0 Answers  


What are two-way data binding and one-way data flow, and how are they different?

0 Answers  


What is the difference between innerHTML and innerText?

0 Answers  


How to create multiline strings in javascript?

0 Answers  


How to get checkbox status whether it is checked or not?

0 Answers  


Does javascript care about whitespace?

0 Answers  


Is javascript frontend or backend?

0 Answers  


Are Attributes and Property the same?

0 Answers  


Can we create buttons in JavaScript ? if yes how? pls provide sample code... Thanks in advance.....

1 Answers   HCL,


Describe briefly the major use of java script on client side

1 Answers  


How to create scale in P info

0 Answers   MAHINDRA,


Should you disable javascript?

0 Answers  


Categories