Java JSB Servlets Question and Answers

9. What do you understand by Servlet Mapping?
 
  • Servlet mapping defines an association between a URL pattern and a servlet.
  • You can use servlet to process a number of url patterns (request pattern).
  • For example, in case of Struts *.do url patterns are processed by Struts Controller Servlet.
 
Your Name Your Email-ID
Your Answer
10. What is meant by web application?
  A web application is a collection of servlets and contents installed under a specific subset of the server's URL namespace such as / catalog and possibly installed via a .war file.
 
Your Name Your Email-ID
Your Answer
11. What is ServletContext?
 
  • ServletContext is an interface that defines a set of methods that a servlet uses to communicate with its servlet container, for example, to get the MIME type of a file, dispatch requests or writes to a log file.
  • There is one context per "web application" per Java Virtual Machine.
 
Your Name Your Email-ID
Your Answer
12. What are the type of protocols supported by HTTPServlet?
 
  • It extends the GenericServlet base class and provides a framework for handling the HTTP protocol.
  • So, HTTPServlet only supports HTTP and HTTPS protocol.
 
Your Name Your Email-ID
Your Answer
123456789101112131415


Page 3 of 15