一 前言 springboot 额外的特色是提供了后台应用监控,可以通过 HTTP 或者 JMX的方式管理监控应用,本文主讲HTTP方式;其主要的功能是监控应用的健康状态,查看环境变量等; 二 pom.xml springboot 2.1.1,主要引入 actuator 依赖,web依赖用于测试; ...
分类:
编程语言 时间:
2019-12-26 09:50:37
阅读次数:
111
1、properties文件内容映射到类对象(属性),如Resource目录下的1.properties文件已配置前缀为com.imooc.people相关的信息,然后: pom添加依赖:springboot-configuration-processor People类对象上方添加注解: @Con ...
分类:
其他好文 时间:
2019-12-26 00:09:05
阅读次数:
283
先在pom文件引入freemark,thymeleaf的依赖,thymeleaf的html文件放在Resource-templates-thymeleaf目录下,freekmarker的ftl文件放在Resource-templates-freemarker目录下,再properties文件设置各自 ...
分类:
编程语言 时间:
2019-12-25 23:44:27
阅读次数:
117
https://www.cnblogs.com/huanghongbo/p/10890025.html 注:用static去定义一个注入的方法或者配置文件值变量,编译时不会有任何异常,运行时会报空指针。 Spring官方不推荐此种方法。 原理: https://www.cnblogs.com/che ...
分类:
编程语言 时间:
2019-12-25 23:34:19
阅读次数:
226
1、配置类 import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceBuilder; import org.springframework.boot.context.properties.ConfigurationPrope ...
分类:
编程语言 时间:
2019-12-25 18:57:49
阅读次数:
103
springboot-habse: https://github.com/spring-projects/spring-hadoop-samples/tree/master/hbase 依赖: <dependency> <groupId>org.springframework.data</group ...
分类:
编程语言 时间:
2019-12-25 16:27:57
阅读次数:
242
一、修改pom.xml文件 1.1 修改打包形式 <!--改为war方式 --> <packaging>war</packaging> 1.2 移除嵌入式tomcat插件 <!-- 在项目打包时,剔除springboot内置tomcat --> <dependency> <groupId>org.s ...
分类:
编程语言 时间:
2019-12-25 16:25:23
阅读次数:
91
标准配置 对比 https://www.cnblogs.com/xiaozhang666/p/12058341.html 的对应注入查看 package com.zys.sys.config; import lombok.Data; import org.springframework.boot.c ...
分类:
编程语言 时间:
2019-12-25 15:56:27
阅读次数:
211
有时候我们程序的接口比较耗时,需要优化,这时我们可能需要了解该接口执行了哪些sql语句以及耗时 1.引入jar包 <!--监控sql日志--> <dependency> <groupId>org.bgee.log4jdbc-log4j2</groupId> <artifactId>log4jdbc- ...
分类:
数据库 时间:
2019-12-25 15:43:02
阅读次数:
215
MyBatis Plus 分页插件 四步走 第一步:编写分页插件配置类 ~~~java //Spring boot方式 @EnableTransactionManagement @Configuration @MapperScan("com.itheima.mapper") public class ...
分类:
编程语言 时间:
2019-12-25 13:11:13
阅读次数:
134