Home » Oracle » 1z0-899 » ServletContextListeners are invoked in A. Random order
ServletContextListeners are invoked in A. Random order
B. contextInitialized and contextDestroyed are invoked in the order in which they are declared in the web.xml
C. contextInitialized method are invoked in the order in which they are declared in the web.xml and the contextDestroyed method is invoked in the reverse order in which they are declared in the web.xml
D. contextInitialized and contextDestroyed are invoked in the reverse order of which they are declared in the web.xml
Correct Answer: C
Explanation/Reference:
public interface ServletContextListener
extends java.util.EventListener
Interface for receiving notification events about ServletContext lifecycle changes.
In order to receive these notification events, the implementation class must be either declared in the deployment descriptor of the web application, annotated with WebListener, or registered via one of the addListener methods defined on ServletContext.
Implementations of this interface are invoked at their contextInitialized(javax.servlet.ServletContextEvent) method in the order in which they have been declared, and at their contextDestroyed(javax.servlet.ServletContextEvent) method in reverse order.
Download Printable PDF. VALID exam to help you PASS.
|
|