Dispatcher-Servlet Load-On-Startup Activities



When programmers deploy the Spring web MVC application to web server or application server then deployment actions takes place :

Part-1
  • web.xml file is loaded and checked for well formness and valid or not.
  • If it is valid and wellformed then in-memory Meta Data will be created for web.xml.
  • Then it will check for Listener, if available then creates listener's object if not left.
  • Then it will create servlet context object.
  • Then it will check for filter, if available then creates the filter's object and do the filtering tasks.
  • Then it will crate servlet config object.
  • If load-on-startup is enabled in web.xml then it will crate an object of DispatcherServlet(means Eager Instantiation of DispatcherServlet).

Part-2

  • Then init() method of DispatcherServlet is called and creates the IOC container of XmlWebApplicationContext.
  • and after that IOC Container takes dispatcher-servlet.xml of WEB-INF folder as spring bean cfg file.
  • Then it checks for wellformness and valid, if wellformed and valid then its in-memory Meta Data will be created.
  • Then because the container is ApplicationContext Container the pre-instantiation of singleton scope spring beans and injections will takes place.
Share:

1 comment:

  1. After listener then filter,interceptor,dispatcherservet component then all details of web.xml will dumped to ServletContext will be created and inside init() method of DispatcherServlet WebApplicationContext type container will be created and if it is using 2 container then nested bean factory concept will come into picture means parent container reference will passed while creating child container.

    ReplyDelete

Quote of the day

Popular Posts

Featured Post

Collection Framework Overview

Collection:- A collection (sometimes called a container) is simply an object that groups multiple elements into single unit. Collect...

Youtube Page

Facebook Page

Recent Posts

About

I am Shivaji Chandra and I'm a Computer Science Engineer. I love to write poems, jokes and quotes. click here →