随笔分类 -  Spring

摘要:简介 Spring基于javax.mail封装了一套用于发送电子邮件的API,位于org.springframework.mail包下,下面将介绍下发送普通文本邮件和基于thymeleaf模版的邮件。 普通邮件 导入javax.mail依赖 Spring配置类 邮件配置:mail.propertie 阅读全文
posted @ 2019-08-01 21:18 布禾 阅读(3609) 评论(0) 推荐(4)
摘要:Spring事务管理分为 声明式事务管理 和 编程式事务 管理,声明式事务管理又分为 xml 和 注解 两种配置方式。应该优先选择声明式事务,因为声明式事务对程序代码的影响最小,因此最符合 非侵入式轻量级容器 的理想 。只有在进行少量事务操作时,才应该选择编程式事务管理的方式。 声明式事务管理 xm 阅读全文
posted @ 2019-07-11 21:15 布禾 阅读(409) 评论(0) 推荐(0)
摘要:目录结构 web.xml: SpringMVC配置类: Controller: 测试类: 可以选择继承AbstractAnnotationConfigDispatcherServletInitializer来替换web.xml中的配置: pom.xml : "Spring pom.xml配置" 阅读全文
posted @ 2019-06-27 22:11 布禾 阅读(1494) 评论(0) 推荐(0)
摘要:``` 4.0.0 com.nocoffee springdemo 0.0.1-SNAPSHOT war 4.3.7.RELEASE org.springframework spring-beans ${spring-version} ... 阅读全文
posted @ 2019-06-25 10:10 布禾 阅读(9129) 评论(0) 推荐(0)