This week's book giveaway is in the Spring forum.
We're giving away four copies of Spring in Action (5th edition) and have Craig Walls on-line!
See this thread for details.
Win a copy of Spring in Action (5th edition) this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

Please answer me this question.  RSS feed

 
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.
 
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.
     
    It is sorta covered in the JavaRanch Style Guide.
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!