• +91 9723535972
  • info@interviewmaterial.com

Servlet Interview Questions and Answers

Question - Explain Request Dispatcher and its methods.

Answer -

Request Dispatcher creates an object that is responsible to receive requests from the browser or client and then navigates them to any resources like Servlets, JSP, or HTML which resides at the server-side.

There are basically two methods of Request Dispatcher:

a) Forward () method:

  • In the Forward() method the client sends the request to the Servlet1.
  • The Servlet1 processes the request and then forwards the request to Servlet2.
  • The servlet2 processes the request and generates a response which in turn is sent back to the client as the final response.
b) Include () method:

  • In Include () method the client sends the request to the Servlet1.
  • The Servlet1 processes the request and then includes the request and sends the request to Servlet2.
  • The servlet2 processes the request and again sends it back to Servlet1 and
  • The Servlet1 generates a response which in turn is sent back to the client as the final response.

Comment(S)

Show all Coment

Leave a Comment




NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners