Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Please answer me this question.

 
Kang Dae Chul
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
QUESTION 96
Place the startup steps in the order in which they are performed before a web application may start servicing client requests.

- Initialize filters defined in the web application deployment descriptor.
- Instantiate listeners defined in the web application deployment descriptor.
- Initialize Servlets to load on startup in the web application deployment descriptor.
- The contextinitialized method is called on listeners implementing Servlet ContextListener which have been instantiated.
 
Frederic Esnault
Ranch Hand
Posts: 284
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you deploy a webapp, the following steps happen in this order BEFORE any client request is processed :

  • Instantiate an instance of each event listener identified by a <listener> element in the deployment descriptor;
  • For listener instances that implement ServletContextListener, call the contextInitialized() method.
  • Instantiate an instance of each filter identified by a <filter> element in the deployment descriptor and call each filter instance�s init() method.
  • Instantiate an instance of each servlet identified by a <servlet> element that includes a <load-on-startup> element in the order defined by the load-onstartup element values, and call each servlet instance�s init() method.


  • This is something you SHOULD know for the exam. When you have this in mind, answer to your question is very clear :

    3 - Initialize filters defined in the web application deployment descriptor.
    1 - Instantiate listeners defined in the web application deployment descriptor.
    4 - Initialize Servlets to load on startup in the web application deployment descriptor.
    2 - The contextinitialized method is called on listeners implementing Servlet ContextListener which have been instantiated.
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic