201908-01 双剑合璧————Spring Boot + Mybatis Plus 引言 最近在学习Mybatis Plus的使用,希望通过spring boot快速将mybatis plus整合进来。 对于springboot项目,mybatis plus团队也有自己的启动器 :mybatis-plus-boot-starter。这个依赖内部已经整合了mybatis-spring,也包括非快速启动的mybatis-plus(这个依赖需要额外的配置数据源等信息),所以如果.... 阅读全文
201907-09 SpringBoot 启动 banner 定制 什么是 banner 爱美之心人皆有之,在 unix 和 linux 命令行环境下工作的闷骚程序员们可能也觉得命令行太单调了,而是他们就发明了在命令行下采用 ansii 字符输出各种图形的方式。这就是命令行下的 banner了,类似下面这样的 linux 命令行 banne.... 阅读全文
201906-14 Jpa操作数据库之动态SQL语句的使用 第一次使用Jpa,之前都是使用的SSM,现在公司换框架为SpringBoot,随之持久层也换为了Jpa,个人感觉Jpa跟Hibernate使用有些相似,好了,废话不多说,上需求,一个表里包含字段[name 名称,cityid 城市ID , parent 父级ID],前台根据这三个字段实现条件查询,这三个参数都不是必须传的,可能前台只给一个,也可能会给多个,按照前台传参去查询数据,如果.... 阅读全文
201906-14 Springboot使用 prometheus监控 添加prometheus的Maven依赖: <dependency> <groupId>io.prometheus</groupId> <artifactId>simpleclient_spring_boot</artifactId> <version>0.0.26</version> </dependency> .... 阅读全文
201906-14 Spring Boot Jpa之构建动态SQL查询语句 引入依赖包: <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jpa</artifactId> </dependency> DAO接口继承JpaSpecificationExecutor.... 阅读全文
201906-06 Spring Security 实战(二) 接下来新建一个配置类WebConfig: package net.maxwoods.spring.config; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframew.... 阅读全文
201906-03 spring boot 启动时关于The APR based Apache Tomcat Native library的问题 在Windows中调试spring boot 2 应用时日志中出现下面信息: [2018-08-04 16:19:29,335][INFO] [localhost-startStop-1] Caller+0 at org.apache.juli.logging.DirectJDKLog.log(DirectJDKLog.java:180) The APR based Apache.... 阅读全文
201905-30 Springboot学习之WebApplicationInitializer Springboot的一个重要功能就是可以消除几乎所有的配置文件,使用JavaConfig取而代之。 而Servlet3.0以后也推崇实用注解的方式取代web.xml配置文件,为了实现这一目的,Springboot提供了对应的类。 WebApplicationInitializer SpringServletContainerInitializer 首先看一下使用web.xml.... 阅读全文
201905-28 sping boot集成thymleaf 创建一个maven工程,指定父pom: <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.1.5.RELEASE</version> </par.... 阅读全文
201809-28 SpringBoot集成RabbitMQ消息队列搭建与ACK消息确认入门 1.Windows下安装RabbitMQ的步骤详解+图解(erlang+RabbitMQ) 2.SpringBoot集成RabbitMQ参考文章 1.RabbitMQ介绍 RabbitMQ是实现AMQP(高级消息队列协议)的消息中间件的一种,最初起源于金融系统,用于在分布式系统中存储转发消息,在易.... 阅读全文