Configuration is the normal configuration
I'm not going to stick it out.
The key is the automatic injection of service packs
Be sure to scan in the parent container , or the transaction cannot be rolled back
The so-called parent container
Spring and spring MVC are a little different
Simply speaking, spring is the parent container.
Spring MVC is a sub-container (may not be appropriate)
Other words
<!--service Pack (auto-inject)--><context:component-scan base-package= "Demo.service"/>
Put it in Applicationcontext.xml if you put it in Springmvc.xml, the transaction will be problematic. Transactions that are not scanned by the parent container will not be rolled back
<welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> <conte Xt-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:/config/ Applicationcontext.xml</param-value> <!--parent container--</context-param> <filter> <description& gt; Character Set filters </description> <filter-name>encodingFilter</filter-name> <filter-class> Org.springframework.web.filter.characterencodingfilter</filter-class> <init-param> <description& gt; Character set encoding </description> <param-name>encoding</param-name> <param-value>utf-8</param-va lue> </init-param> </filter> <filter-mapping> <filter-name>encodingfilter</filter-na me> <url-pattern>/*</url-pattern> </filter-mapping> <listener> <description>sprin G Listener </description> <LISTENER-CLASS>org.springframework.web.context.contextloaderlistener</listener-class> </listener> <listener > <listener-class>org.springframework.web.util.IntrospectorCleanupListener</listener-class> </ listener> <servlet> <servlet-name>SpringMVC</servlet-name> <servlet-class> Org.springframework.web.servlet.dispatcherservlet</servlet-class> <init-param> <description> Spring MVC configuration file </description> <param-name>contextConfigLocation</param-name> <param-value& Gt;classpath:/config/spring-mvc.xml</param-value><span style= "FONT-SIZE:24PX;" ><!--Sub-containers--></span> </init-param> <load-on-startup>1</load-on-startup> </SERVL Et>
Questions about Spring MVC not going to roll