• +91 9971497814
  • info@interviewmaterial.com

Computer Interview Questions Answers

Servlet Interview Questions Answers

Question - 21 : - What is servlet mapping?

Answer - 21 : - The servlet mapping defines an association between a URL pattern and a servlet. The mapping is used to map requests to servlets.

Question - 22 : - When we don't write any constructor for the servlet, how does container create an instance of servlet?

Answer - 22 : - Container creates instance of servlet by calling Class.forName(className).newInstance().  

Question - 23 : - What is the difference between callling a RequestDispatcher using ServletRequest and ServletContext?

Answer - 23 : - We can give relative URL when we use ServletRequest and not while using ServletContext.

Question - 24 : - Difference between GET and POST ?

Answer - 24 : - In GET your entire form submission can be encapsulated in one URL, like a hyperlink. query length is limited to 260 characters, not secure, faster, quick and easy. In POST Your name/value pairs inside the body of the HTTP request, which makes for a cleaner URL and imposes no size limitations on the form's output. It is used to send a chunk of data to the server to be processed, more versatile, most secure.

Question - 25 : - What is servlet container?

Answer - 25 : - The servlet container is a part of a Web server or application server that provides the network services over which requests and responses are sent, decodes MIME-based requests, and formats MIME-based responses. A servlet container also contains and manages servlets through their lifecycle.

Computer Contributors

krishan
Rajeev Katiyar
Yes Baroda

Share your email for latest updates

Name:
Email:

Our partners