aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Please answer me this question. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Please answer me this question. " Watch "Please answer me this question. " New topic
Author

Please answer me this question.

Kang Dae Chul
Greenhorn

Joined: Dec 30, 2005
Posts: 4
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

Joined: Feb 13, 2006
Posts: 284
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.


    SCJP 5 - SCWCD 1.4 - SCBCD 1.3 - Certification study documents/resources: http://esnault.frederic.free.fr/certification
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: Please answer me this question.
     
    Similar Threads
    Can anybody answer this question?
    servlet life cycle mixed with listeners and filters
    Doubt on Session Attribute and Web Deployment
    Passed SCWCD with 94% - My two cents
    servlet startup order