- 博客(5)
- 收藏
- 关注
原创 Spring Boot :事件和监听器(Application events and listeners)
一般您不需要使用应用程序事件,但可以方便地知道它们存在。 在内部,Spring Boot使用事件来处理各种任务。 实现ApplicationListener接口: @Slf4j public class ApplicationStartedEventListener implements ApplicationListener<ApplicationStartedEvent> { ...
2018-12-26 11:13:51 720
原创 SpringBoot 利用注解实现AOP
自定义注解 @Target({ ElementType.METHOD, ElementType.TYPE }) @Retention(RetentionPolicy.RUNTIME) @Documented public @interface OperateLog{ String value(); } 添加切面监听 @Aspect @Component public class Ope...
2018-12-25 20:39:39 318
原创 利用Jackson自定义JSON序列化工具
背景: @JsonFormat(pattern=“yyyy-MM-dd”) 将Date转换成String 一般后台传值给前台时 @JsonFormat会让时间以0区时间显示(格林尼治时间)。如果直接使用会少了8小时(我所在的是北京时区)修改为 @JsonFormat(pattern=“yyyy-MM-dd”,timezone=“GMT+8”) /**更新时间 用户可以点击更新,保存最新更新的时间...
2018-12-25 20:23:11 1419
原创 理解Spring ,Spring MVC和Spring Boot
前言 从Servlet技术到Spring和Spring MVC,开发Web应用变得越来越简捷。但是Spring和Spring MVC的众多配置有时却有点繁琐,相信有过Spring MVC开发经验的朋友能深刻体会到这一痛苦。因为即使是开发一个Hello-World的Web应用,都需要我们在pom文件中导入各种依赖,编写web.xml、spring.xml、springmvc.xml配置文件等。 所以...
2018-12-21 15:45:37 179
原创 JDK8 新特性
1. Lambda表达式和函数式接口 forEach: Arrays.asList( &amp;amp;amp;amp;quot;a&amp;amp;amp;amp;quot;, &amp;amp;amp;amp;quot;b&amp;amp;amp;amp;quot;, &amp;amp;amp;amp;quot;d&amp;amp;amp;amp;quot; ).forEach( e -&
2018-12-05 12:02:21 376 1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人