
Spring 系列
随馨索玉
这个作者很懒,什么都没留下…
展开
-
1、Spring Boot 集成 JSP WEB页面
1、Springboot 官方已经不建议使用JSP 开发web 项目,建议使用模板 ,例如freemarker velocity2、考虑当前研发成员对框架的熟悉情况,以及后期项目架构调整的计划,还是暂时使用JSP3、Springboot 构建JSP web 配置构建项目:file-->new -->project-->spring initializr ,填写项目名称...原创 2019-05-17 10:48:37 · 832 阅读 · 0 评论 -
2、springboot 集成 log4j2
1、Spring boot默认是使用logback来进行日志记录,而大多数框架依赖log4j,即将logback替换为log4j22、引入log4j2 的maven依赖3、如果引入springboot 其他组件的自动启动包,也要注意是否默认启用了logback ,例如aop启动包也需要去除logback依赖4、配置log4j2的启动参数配置文件放在...原创 2019-05-17 11:02:23 · 1259 阅读 · 0 评论 -
3、spring boot 配置druid 连接池及监控
1、druid githun项目地址https://github.com/alibaba/druidhttps://github.com/alibaba/druid/wiki/常见问题 (必看)2、druid 的过滤器 (重要)stat,wall,log4j2stat:Druid内置提供一个StatFilter,用于统计监控信息。wall:Druid防御SQL注...原创 2019-05-17 11:23:35 · 1408 阅读 · 0 评论 -
4、在IntelliJ idea 中基于spring-boot-devtools 实现项目热启动
1、引入spring-boot-devtools maven依赖2、开启idea自动build功能3、组合键:Shift+ALT+Ctrl+/ ,选择“Registry”,回车,找到“complier.automake.allow.when.app.running”4、 设置maven plugin属性<fork>true</fork><...原创 2019-05-17 11:28:53 · 787 阅读 · 0 评论 -
5、springboot集成 mybatis generator 代码生成工具
1、配置 mybatis generator 自动生成代码插件2、代码自动生成配置文件generatorConfig.xml <?xmlversion="1.0"encoding="UTF-8"?> <!DOCTYPE generatorConfiguration PUBLIC "-//mybatis.org//D...原创 2019-05-17 11:37:00 · 200 阅读 · 0 评论 -
6、springboot 集成mybatis
http://www.mybatis.org/mybatis-3/https://github.com/mybatis/spring-boot-starter1、添加mybatis 相关依赖2、在application.properties 设置 mybatis 参数mybatis 配置参数 ######### mybatis ########### ...原创 2019-05-17 11:47:03 · 236 阅读 · 0 评论 -
7、Springboot 集成分页插件pagehelper
1、官网https://pagehelper.github.io/2、集成springboot文档 https://github.com/pagehelper/pagehelper-spring-boot使用细则:https://github.com/pagehelper/Mybatis-PageHelper/blob/master/wikis/zh/HowToUse.mdexampl...原创 2019-05-17 12:04:42 · 1987 阅读 · 0 评论 -
8、Springboot 集成Aop
1、引入aop maven依赖注意:(1) 去除默认logging组件,因为我们框架已经更改使用log4j2; (2)引入依赖后AOP默认开启,无需再添加开启aop注解2、声明aop切面处理类(切面处理操作实现类)@Aspect @Component@Order(index)注:怎样声明一个自定义注解?要用到4个元注解:(具体实现方式不详细说明)...原创 2019-05-17 15:53:55 · 325 阅读 · 0 评论 -
9、springboot 集成 kaptcha验证码
kaptcha:https://github.com/penggle/kaptcha基于 SimpleCaptcha 开发的验证码插件,google开源插件1、引入kaptcha maven依赖kaptcha 依赖 <!--kaptcha验证码生成器--> <dependency> <groupId>com.git...原创 2019-05-17 15:58:12 · 558 阅读 · 0 评论