Which interface is implemented by the services in order to pass configuration information to a Servlet when it first starts
-
Structs Config
-
WebXML
-
ServletConfig
-
None of the above
ServletConfig is an interface implemented by the servlet container to pass configuration information (init parameters, servlet context) to a servlet during initialization. It's accessed via getServletConfig(). Struts Config is framework-specific, WebXML is deployment descriptor format.
In the Java Servlet API, when a servlet container instantiates and initializes a Servlet, it passes it a ServletConfig object (via the init(ServletConfig) method) that carries servlet-specific initialization parameters defined in web.xml, along with a reference to the ServletContext. This is the standard, documented mechanism for delivering startup configuration to an individual servlet. 'Struts Config' is a Struts-framework-specific configuration file, unrelated to the base Servlet API's init mechanism. 'WebXML' is the deployment descriptor file itself, not an interface implemented by services. ServletConfig is precisely the interface designed for this purpose.