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

Why servlet is faster than jsp?

1009


What is servlet in web technology?

984


In the servlets, we are having a web page that is invoking servlets ,username and password? which is checks in database? Suppose the second page also if we want to verify

958


What is the process for chaining servlet?

991


What’s the difference between genericservlet and httpservlet?

1018


What’s the difference between forward() and sendredirect() methods?

956


What is cookie? Why is cookie used?

1006


What are the phases of the servlet life cycle?

1050


What is meant by Servlet? What are the parameters of service method?

1006


Can you explain in detail 'javax.servlet' package?

935


What is servlet and its advantages?

992


What are the different ways we can maintain state between requests?

1044


What is the capacity the doget can send to the server?

1016


How do I support both get and post from the same servlet?

1170


What are common tasks performed by Servlet Container?

1205