Sr.Java Web Developer Question: Download Sr.Java Web Developer PDF

Do you know the role of DispatcherServlet and ContextLoaderListener?

Tweet Share WhatsApp

Answer:

☛ DispatcherServlet is basically the front controller in the Spring MVC application as it loads the spring bean configuration file and initializes all the beans that have been configured. If annotations are enabled, it also scans the packages to configure any bean annotated with @Component, @Controller, @Repository or @Service annotations.

☛ ContextLoaderListener, on the other hand, is the listener to start up and shut down the WebApplicationContext in Spring root. Some of its important functions includes tying up the lifecycle of Application Context to the lifecycle of the ServletContext and automating the creation of ApplicationContext.

Download Sr.Java Web Developer PDF Read All 64 Sr.Java Web Developer Questions
Previous QuestionNext Question
Tell me what are the steps to connect to a database in java?Please explain why should we not configure JSP standard tags in web.xml?