Do you need a Spring consolidation Springmvc?
Do you need to add the Spring IOC container again?
Do I need to configure the Contextloaderlistener in the Web. xml file to start the Spring IOC container?
1. Required: Typically, similar to data sources, transactions, and consolidation other frameworks are placed in the Spring configuration file (not in the SPRINGMVC configuration file).
In fact, there are Service and Dao in the IOC container corresponding to the Spring configuration file.
2. Not required: Both are placed in the SPRINGMVC configuration file. You can also divide multiple Spring profiles and import other profiles using the import node
Problem: If Spring's IOC container and SPRINGMVC's IOC container have a coincident portion of the packet scanned, it will cause some beans to be created 2 times.
Solve:
1. The package scanned by the Spring IOC container and the SPRINGMVC IOC container have no coincident parts.
2. Use Exclude-filter and Include-filter subnodes to specify annotations that can only be scanned
The beans in the Springmvc IOC container can refer to beans in the Spring IOC container.
Return to it? Conversely, it is not. The beans in the Spring IOC container cannot refer to the bean! in the SPRINGMVC IOC container
Spring integrates spring MVC