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

What is servlet and its use?

1116


What is dispatcher servlet?

1065


How to create war file?

1165


Tell the new features added in servletrequest interface i.e. Servlet 2.4

1173


How forward () method is different from send redirect () method?

970


How to upload a file to the server using servlet?

1000


How do cookies work in servlets?

1051


Explain mvc pattern.

1024


What are all the protocols supported by httpservlet?

1282


What are the types of servlets? Explain

1267


What is difference between server and servlet?

1092


How can we implement a jsp page?

1138


What is Servlets and explain the advantages of Servlet life cycle?

1109


Write all the phases defined in servlet life cycle?

1160


How do you find out what client machine is making a request to your servlet

1062