How many ways are available to ger RequestDispatcher object?

Answers were Sorted based on User's Feedback



How many ways are available to ger RequestDispatcher object?..

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

How many ways are available to ger RequestDispatcher object?..

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

How many ways are available to ger RequestDispatcher object?..

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

How many ways are available to ger RequestDispatcher object?..

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

Post New Answer

More Servlets Interview Questions

What do you mean by interservlet communication?

1 Answers  


Tell us something about servletconfig interface.

1 Answers  


What is SingleThreadModel interface?

1 Answers  


why we should override only no-agrs init() method.

1 Answers  


How can the referrer and the target urls be used in servlet?

1 Answers  


Explain the war file?

1 Answers  


What is URL Encoding?

1 Answers  


What are different methods of session management in servlets?

1 Answers  


describe all about advanced java with presentation

4 Answers   Sun Microsystems,


When Servlet is unloaded?

1 Answers  


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

1 Answers  


How are Sessions are more advantage than using of Cookies or URLReWriting?

2 Answers   CTS,


Categories