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

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.http.RequestDispatcher;
public class dispatcher extends HttpServlet throws
IOException, ServletException {
public void doGet(HttpServletRequest request,
HttpServletResponse response) {
RequestDispatcher dis=
request.getRequestDispatcher("welcome.jsp");
dis.forward(request, response);//it will go to ur
desired page.
dis.include("Hello java");//it will display ur
message also to ur desired page.
}


}

Is This Answer Correct ?    10 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to rectify errors in java servlet while compilation?

909


What is a deployment descriptor?

1066


What are the types of Session Tracking ?

1096


What are the difference between session and cookies in servlet? Explain

1009


What do you mean by annotations in servlet?

1014


What are the difference between RMI and Servlets?

1524


Why do we use sendredirect() method?

940


What is servlet and its types?

1010


How servlet is created?

1133


What is servlet name in web xml?

955


What is difference between ServletResponse sendRedirect() and RequestDispatcher forward() method?

1066


What’s the difference between genericservlet and httpservlet?

1033


What is the difference between Difference between doGet() and doPost()?

1229


What's the architecture of a servlet package?

992


what is servlet chaining?

1048