In the init(ServletConfig) method of Servlet life cycle, what method can be used to access the ServletConfig object ?
-
getServletInfo()
-
getInitParameters()
-
getServletConfig()
-
None
C
Correct answer
Explanation
The init(ServletConfig) method receives the ServletConfig object as a parameter. The getServletConfig() method returns this ServletConfig object, which contains initialization parameters and servlet configuration. getServletInfo() returns servlet information (author, version etc.), not the config object. getInitParameters() is not a standard method - parameters are accessed via getInitParameter() on the config object.