DI and IOC in spring mvc implementation
I am new to spring mvc and DI. I have came to know about the flow of the spring project and i know how the web projects in spring mvc is developed and worked on few projects too. All the annotation uses and xml configuration files in the spring mvc. But i am confused where the DI is used? and how the DI is implemented in spring with the help of IOC??
Can anyone please explain me the concept of DI and IOC and their implementation in spring mvc.
Thanks in advance!!!
DI and IOC happening through web.xml where you created the dispatcherservlet. From Spring MVC docs : The DispatcherServlet, provides a shared algorithm for request processing while actual work is performed by configurable, delegate components The DispatcherServlet, as any Servlet, needs to be declared and mapped according to the Servlet specification using Java configuration or in web.xml. In turn the DispatcherServlet uses Spring configuration to discover the delegate components it needs for request mapping, view resolution, exception handling, and more.
internally it will register Spring mvc app and it will create an object and inject dependencies .
链接地址: http://www.djcxy.com/p/82196.html上一篇: 设计模式:缓存和上下文
下一篇: DI和IOC在春季mvc实施