03 2017 档案

摘要:前言 到目前为止,把项目中需要用到的:properties读取、数据源配置、整合mybatis/JdbcTemplate、AOP、WebService、redis、filter、interceptor、定时器等,都简单的去用spring boot整合学习了一下。与学习之初对spring boot的理解并没有什么大的区别,只是大致知道怎么配置/注入想要的。 一、准备 1.1 redis服务端... 阅读全文
posted @ 2017-03-28 00:31 淡丶无欲 阅读(692) 评论(0) 推荐(0)
摘要:前言 github: https://github.com/vergilyn/SpringBootDemo 代码位置: 参考: Spring Boot Reference Guide , §77.2 Configure Two DataSources springboot + mybatis + 多数据源 springboot + mybatis + ... 阅读全文
posted @ 2017-03-27 00:15 淡丶无欲 阅读(2609) 评论(0) 推荐(0)
摘要:前言 github: https://github.com/vergilyn/SpringBootDemo 一、AOP 官方demo:https://github.com/spring-projects/spring-boot/tree/master/spring-boot-samples/spring-boot-sample-aop 1.1 pom依赖 org.springfra... 阅读全文
posted @ 2017-03-19 19:58 淡丶无欲 阅读(5844) 评论(0) 推荐(0)
摘要:前言 github: https://github.com/vergilyn/SpringBootDemo 代码位置: 一、准备 spring boot对jersey1.x与jersey2.x的注入方式有区别。本文是针对2.x的配置(服务端,不包含客户端调用。) 需要依赖的POMs org.springframework.boot spring-boot-starter... 阅读全文
posted @ 2017-03-14 00:32 淡丶无欲 阅读(4652) 评论(1) 推荐(0)
摘要:前言 github: https://github.com/vergilyn/SpringBootDemo 代码位置: 一、Spring Boot集成JdbcTemplate或NamedParameterJdbcTemplate spring boot中JdbcTemplate与NamedParameterJdbcTemplate都是被自动配置的,所以只要注入就可用。(在传统的spr... 阅读全文
posted @ 2017-03-13 00:11 淡丶无欲 阅读(3656) 评论(0) 推荐(0)
摘要:前言 github: https://github.com/vergilyn/SpringBootDemo 说明:我代码的结构是用profile来区分/激活要加载的配置,从而在一个project中写各种spring boot的demo。所以很多时候可能在*Application.class中指定了特殊的profile。 这种方式可能很糟糕(在细看理解application.prop... 阅读全文
posted @ 2017-03-12 01:57 淡丶无欲 阅读(6154) 评论(0) 推荐(0)
摘要:前言 github: https://github.com/vergilyn/SpringBootDemo 代码位置:(注意测试方法在,test下的SpelValueApplicationTest.class) 一、什么是SpEL SpEL:spring表达式语言,Spring Expression Language。从spring3开始引入。 可以通过xml或注解的施行... 阅读全文
posted @ 2017-03-11 02:28 淡丶无欲 阅读(4309) 评论(0) 推荐(1)
摘要:前言 算是对《SpringBoot初学(2) - properties配置和读取》的总结吧。 概念性总结 一、Spring Boot允许外化(externalize)你的配置。可以使用properties文件,YAML文件,环境变量和命令行参数来外化配置。 使用@Value注解,可以直接将属性值注入到你的beans中,并通过Spring的Environment抽象或绑定到结构化对象... 阅读全文
posted @ 2017-03-11 01:53 淡丶无欲 阅读(4262) 评论(0) 推荐(0)