• +91 9723535972
  • info@interviewmaterial.com

Spring Interview Questions and Answers

Question - What is ContextLoaderListener and what does it do?

Answer -

  • The ContextLoaderListener loads and creates the ApplicationContext, so a developer need not write explicit code to do create it. In short, it is a listener that aids to bootstrap Spring MVC.
  • The application context is where Spring bean resides. For a web application, there is a subclass called WebAppliationContext.
  • The lifecycle of the ApplicationContext is tied to the lifecycle of the ServletContext by using ContextLoaderListener. The ServletContext from the WebApplicationContext can be obtained using the getServletContext() method.

Comment(S)

Show all Coment

Leave a Comment




NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners