纯注解开发SSM

用注解替代applicationContext.xml
同前期设置,添加事务注解驱动 @Configuration
//扫描组件,排除SpringMVC对应的bean,等同于
@ComponentScan(value = "com.itheima",excludeFilters = {
@ComponentScan.Filter(type= FilterType.ANNOTATION,classes = {Controller.class})})
@PropertySource("classpath:jdbc.properties")
@Import({JdbcConfig.class,MyBatisConfig.class})
//等同于,导入的默认名称为transactionManager
@EnableTransactionManagement
public clas

纯注解开发SSM最先出现在Python成神之路

版权声明:
作者:dingding
链接:https://www.techfm.club/p/14872.html
来源:TechFM
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
< <上一篇
下一篇>>