先对Spring SpringMVC和Mybatis单独进行配置,最后对三者进行整合配置
Spring
实际使用中,一般会使用注解+xml配置来实现spring功能,其中xml配置对上文进行总结,配置内容如下
<context:component-scan base-package="com.jdbcTemplate" ></context:component-scan>
<aop:aspectj-autoproxy></aop:aspectj-autoproxy>
<bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource" destroy-method="close">
<property name="url" value="jdbc:mysql:/book"/>
<property name="username" value = "root"/>
<property name="password" value = "LRY990722"/>
<property name="driverClassName" value="com.mysql.jdbc.Driver"/>
</bean>
<bean id="'jdbcTem