A servlet needs to read its own initialization parameters and also share a database connection pool. Which combination of objects should it use?
- getInitParameter() and ServletContext
- getServletConfig() and getServletContext()
- getServletContext() and getInitParameter()
- getServletContext() and getInitParameter()
To read its own initialization parameters, a servlet should use getInitParameter(). To share a database connection pool, it should use the ServletContext, which is accessible via getServletContext().
Loading...
Related Quiz
- The ___________ method is often used to log debugging information in servlets.
- To track the creation and destruction of HttpSession objects, the _________ interface is implemented.
- A servlet forwards a request to a JSP page for rendering the view. Which method does it use, and what happens to the URL in the browser?
- Servlets in an MVC framework typically receive user input through __________.
- The __________ object provides the filter with its configuration information.