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 is servlet container. how it works?

0 Answers  


How to pass session values from one servlet container to another servlet container? or how can we get session values of one container in another container?

6 Answers   IBM, Infosys, TCS,


If some new data has entered the database, explain how can a servlet refresh automatically?

0 Answers   BirlaSoft,


What is servletconfig?

0 Answers  


What do you mean by request dispatcher in servlet? Also explain its methods.

0 Answers  






Hi guys.. Well can u tell me that why there is need of "init()" , i mean why can not we initialize the servlet object with the help of constructors? Thank you.

7 Answers  


What is the use of servlet context?

0 Answers  


Why HttpServlet class is declared abstract?

0 Answers  


What is servlet name in web xml?

0 Answers  


If my browser does not support cookie, and my server sends a cookie instance what will happen?

0 Answers  


What does the term localization refer to?

0 Answers  


How do you communicate in between Applets and Servlets?

0 Answers  


Categories