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

program for RequestDispatcher in servlets?

Answer Posted / avinah kapoor

import javax.servlet.*;
import javax.servlet.http.*;
public class RequestDispatcherDemo extends HttpServlet
{
public void doGet(HttpServletRequest
req,HttpServletResponse res) throws ServletException
{
res.setContentType("text/html");
PrintWriter out=res.getWriter();
RequestDespatcher rd=req.getRequestDispacher("welcome");

rd.forward(req,res);//it forwart the response to
welcome servlet page but cant take resource calling page.
}
}

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why do we have servlet wrapper classes?

1064


What are the differences between servlet context vs servlet config?

1079


What is a servlet context object?

1132


What is cgi and what are its drawbacks?

1059


What is servlet initializer?

970


What is the difference between the include() and forward() methods?

1077


Explain the working of service() method of a servlet.

953


What are the types of servlets? Explain

1257


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

1019


What are the uses of servlet

1172


What is servlet invoker?

1034


Which are the different ways you can communicate between servlets?

995


How can we upload the file to the server using servlet?

1079


Difference between forward() method and sendredirect() method ?

1030


what is the different between a servlet and a cgi? Why do you go for servlet rather than cgi?

1041