摘要: 1、显示出sql内容: 新建2个类:MybatisInterceptor ;拦截sql,并获得输出sql内容 2、在新建sql格式化工具,格式化sql语句 3、在spring的配置文件中添加 配置插件 配置注入的内容 2、如果使用的是Druid来连接的数据库 在web.xml文件中添加下面的信息 阅读全文
posted @ 2017-12-11 17:38 start枫 阅读(2063) 评论(0) 推荐(0) 编辑
摘要: pringMVC集成springfox-swagger2和springfox-swagger-ui很简单,只需要两步: (1)pom中添加依赖 [java] view plain copy <dependency> <groupId>io.springfox</groupId> <artifactI 阅读全文
posted @ 2017-12-11 11:34 start枫 阅读(7042) 评论(0) 推荐(0) 编辑
摘要: 1,保存一个key-value形式的结构到redis 2,把一个对象保存成hash形式的结构到redis 代码如下: // 保存key-value值 pushFrequencyTemplate.opsForValue().set("test_key", "test_value111"); // 读取 阅读全文
posted @ 2017-12-08 14:50 start枫 阅读(697) 评论(0) 推荐(0) 编辑
摘要: 我们以一个最简单的例子来完成这个需求:定义一个注解EnableContentService,使用了这个注解的程序会自动注入ContentService这个bean。 然后在应用程序的入口加上@EnableContentService注解。 这样的话,ContentService就被注入进来了。 Sp 阅读全文
posted @ 2017-12-06 16:35 start枫 阅读(3818) 评论(0) 推荐(0) 编辑
摘要: 使用 Maven 工程,我的 pom 文件如下所示: 连接机器 Index API 创建 Index 并且插入 Document 创建索引有很多种方法,这里列举常用的 2 种: 注意:Index API 只能用于创建 index,类似于关系型数据库里面的 create table,他不能对已有的数据 阅读全文
posted @ 2017-12-05 18:12 start枫 阅读(238) 评论(0) 推荐(0) 编辑
摘要: SpringBoot源码分析之SpringBoot的启动过程 发表于 2017-04-30 | 分类于 springboot | 0 Comments | 阅读次数 SpringBoot的启动很简单,代码如下: 1 2 3 4 5 6 @SpringBootApplication public cl 阅读全文
posted @ 2017-12-05 12:29 start枫 阅读(318) 评论(0) 推荐(0) 编辑
摘要: 8.1 配置 Spring MVC的配置是通过继承WebMvcConfigurerAdapter类并重载其方法实现的; 前几个教程已做了得配置包括 01点睛Spring MVC 4.1-搭建环境 配置viewResolver 03点睛Spring MVC 4.1-REST 静态资源映射 04点睛Sp 阅读全文
posted @ 2017-12-05 11:54 start枫 阅读(1302) 评论(0) 推荐(0) 编辑
摘要: 使用过springSecurity的朋友都知道,首先需要在web.xml进行以下配置 [java] view plain copy <filter> <filter-name>springSecurityFilterChain</filter-name> <filter-class>org.spri 阅读全文
posted @ 2017-12-04 10:11 start枫 阅读(1060) 评论(0) 推荐(0) 编辑
摘要: 需求缘起:有人在【springboot】微信公众号问:springboot启动慢的问题何时有个分享就好了,谢谢。粉丝的问题还是要认真的回答的。 我们先看看本节的大纲: (1)组件自动扫描带来的问题(@SpringBootApplication);(2)如何避免组件自动扫描带来的问题(不使用@ Spr 阅读全文
posted @ 2017-12-01 17:54 start枫 阅读(55974) 评论(0) 推荐(0) 编辑
摘要: @Cacheable、@CachePut、@CacheEvict 注释介绍 @Cacheable 的作用 主要针对方法配置,能够根据方法的请求参数对其结果进行缓存 --////////////////////////////////////////////////////////////////// 阅读全文
posted @ 2017-11-08 11:23 start枫 阅读(397) 评论(0) 推荐(0) 编辑