How many ways are available to ger RequestDispatcher object?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which interface must be implemented by all servlets?

799


When jsessionid is created?

609


What's the servlet interface?

598


What is http servlet? Explain with the help of an example.

581


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

534






What is the difference between Server and Container?

621


What is war file?

583


Describe some assignments that are executed by servlet container?

587


What is the life-cycle of servlets?

637


Describe servlet?

582


What is dispatcher servlet?

561


What are the uses of servlet

635


What is preinitialization of a servlet?

586


What are the advantages of cookies?

632


How do you create a cookie using servlet?

581