首页 > 其他分享 >【Spring】整合SpringMVC、MyBatis

【Spring】整合SpringMVC、MyBatis

时间:2022-12-09 12:06:49浏览次数:35  
标签:www http tx SpringMVC Spring springframework MyBatis org schema


在使用xml配置方式的最佳整合方式:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-4.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-4.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-4.0.xsd">

<!-- 整合mybatis -->
<import resource="classpath:spring-mybatis.xml"/>
<!-- 事务控制 -->
<import resource="classpath:spring-transaction.xml"/>
<!-- springMVC配置 -->
<import resource="classpath:springMVC.xml"/>

</beans>



标签:www,http,tx,SpringMVC,Spring,springframework,MyBatis,org,schema
From: https://blog.51cto.com/u_15907520/5924535

相关文章