Sr.Java Web Developer Question: Download Questions PDF
Do you know the role of DispatcherServlet and ContextLoaderListener?
![Sr.Java Web Developer Interview Answer Sr.Java Web Developer Interview Question](https://globalguideline.com/public/images/interview/18.png)
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.
☛ 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 Interview Questions And Answers
PDF
Previous Question | Next 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? |