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

Write a program to show the functionality of servlets.

1004


How servlets are deployed in java?

1013


What is the servletconfig object?

1033


What are the steps involved in placing a servlet within a package?

1074


When should you prefer to use doget() over dopost()?

1146


What are the advantages of servlets over traditional cgi?

1089


How the JSP file will be executed on the Server side?

1131


What is meant by session? Tell me something about httpsession class?

1008


How do cookies work in servlets?

1040


What is the need of session tracking in web application?

1026


What is difference between PrintWriter and ServletOutputStream?

1289


What do you understand by mime type?

982


What is servlet in tomcat?

1048


When servlet object is created?

1148


What is the difference between servlet and filter?

942