How many ways are available to ger RequestDispatcher object?
Answers were Sorted based on User's Feedback
Answer / vijay
by two ways we can get the RequestDispatcher object.
1) by using ServletContext.getRequestDispatcher().
2)by using HttpServletRquest.getRequestDispatcher().this
method inherted from ServletRequest.
Is This Answer Correct ? | 24 Yes | 4 No |
Answer / rice
There are two ways to get RequestDispatcher object in the
servlet.
1. calling the getRequestDispatcher(String path) method on
ServletRequest.
RequestDispatcher rd=request.getRequestDispatcher(String path);
2. By getRequRequestDispatcher(String path) method on
ServletContext.
RequestDispatcher rd=context.getRequestDispatcher(String path);
Is This Answer Correct ? | 17 Yes | 0 No |
Answer / seshendra
There are three ways to get RequestDispatcher object in the
servlet.
1. calling the getRequestDispatcher(String path) method on
ServletRequest.
RequestDispatcher rd=request.getRequestDispatcher(String path);
2. By getRequRequestDispatcher(String path) method on
ServletContext.
RequestDispatcher rd=context.getRequestDispatcher(String path);
3.by calling getNamedDispatcher(servlet logical name)on
ServletContext object
RequestDispatcher rd=context.getNamedDispatcher(servlet
logical name)
Is This Answer Correct ? | 15 Yes | 0 No |
Answer / venkat
there are two ways.
RequestDispatcher rd=req.getRequestDispatcher("\a.jsp");
RequestDispatcher rd=sc.getRequestDispatcher("\a.jsp");
Is This Answer Correct ? | 3 Yes | 0 No |
What is the difference between a generic servlet and http servlet?
Write a simple servlet program to print the contents of html.
How the typical servlet code look like ?
Explain Action Servlet?
What is the directory structure of a war file?
what is the difference between Servlet and JSP?Advantage of JSP over Servelt?Any concept present in JSP which we cant implement in Servlet?
31 Answers ABC, Apere, AZTEC, CTS, CybAge, iFlex, Impact Systems, Sara, TCS,
What are different ways for authentication of servlet?
What is servlet in tomcat?
Hi friends, am newbie to servlet. My interviewer asked why used servlet in your application. i used servlet for controller logic and business logic . is it correct ?
What is forward() and include() of servlets RequestDispatcher interface?
how can we create object to a class in a jsp file?
5 Answers Accenture, L&T, TCS,
How multiple simultaneous requests can be handled by servlets?