SpringBoot
文章平均质量分 68
<yinweijian>
不想写代码了
展开
-
springboot 普通类获取bean
工具类SpringContextUtilimport org.springframework.beans.BeansException;import org.springframework.beans.factory.support.BeanDefinitionBuilder;import org.springframework.beans.factory.support.Def...原创 2019-10-26 11:31:41 · 759 阅读 · 0 评论 -
SpringBoot整合Log4j2
同事配置了个鬼配置文件,用都用不了,配的也不对,一气之下把它改了,现在做个笔记,方便后期用上时直接Ctrl+C\Ctrl+V主要有一个功用:1、控制台输出2、日志保存到文件(按文件大小)3、日志按级别输出到文件中1、控制台输出pom.xml主要配置: <dependency> <groupId>org.springfram...原创 2018-09-25 14:41:07 · 1512 阅读 · 0 评论 -
springboot打包好的Jar文件运行时引用外部的配置文件
去Interview时被问了这个问题,之前都是直接在idea里改好再打包了,所以没有直接引用外部文件过,通过查看SpringBoot官网,得知有下面的几种方法:24.3 Application Property FilesSpringApplication loads properties from application.properties files in the following...原创 2018-10-18 10:21:37 · 6056 阅读 · 3 评论 -
SpringBoot + Redis (LocalDateTime保存问题)
application.ymlspring: redis: host: 192.168.1.211 port: 6379 password: 123456 lettuce: pool: max-active: 8 max-idle: 8 max-wait: -1ms min-id...原创 2019-01-31 14:51:48 · 764 阅读 · 0 评论 -
sharding-jdbc 3.0 分库分表
网址:https://shardingsphere.apache.org/document/current/cn/overview/依赖:<dependency> <groupId>io.shardingsphere</groupId> <artifactId>sharding-jdbc<...原创 2019-03-24 22:48:53 · 534 阅读 · 0 评论 -
springboot拦截器校验或鉴权导致Required request body is missing解决方法
纯笔记:例子总共有5个JAVA文件DemoApplication.java(springbooy启动类)XXXFilter.javaXXXHandler.javaXXXRequestWrapper.javaXXXWebMvc.java出现这个错误的原因参考:https://www.cnblogs.com/yepei/p/7011081.html大概思路:重新定义一个Ht...原创 2019-03-18 09:37:18 · 6276 阅读 · 5 评论 -
java list转成treenode、list转成tree
TreeNode.javapackage com.example.demo.t1;import com.alibaba.fastjson.annotation.JSONField;import lombok.Data;import java.util.ArrayList;import java.util.List;@Datapublic class TreeNode {...原创 2019-03-30 13:43:28 · 2428 阅读 · 0 评论 -
LocalDateTime 和 Date 相互转换,LocalDateTime获取时间戳,时间戳转LocalDateTime
LocalDateTime a = new Date().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();System.out.println(a);Date b = Date.from(a.atZone(ZoneId.systemDefault()).toInstant());System.out.println...原创 2019-03-29 11:08:29 · 2519 阅读 · 0 评论 -
SpringBoot RabbitMQ 延时队列 (ttl)
流程:[ttl.exchange] --<ttl.routing-kye>--[ttl.queue(此queue指定到期后的exchage)] -- >[普通exchange] --<普通routing-key> --> [普通queue]RabbitMQConfigpackage com.example.rabbitmqttl.config;...原创 2019-05-26 22:47:03 · 871 阅读 · 0 评论 -
springboot 启动时获取所有注入的bean,springboot通过返回调用bean的方法
import java.lang.reflect.Method;import org.springframework.util.ReflectionUtils;ConfigurableApplicationContext run = SpringApplication.run(ShopApiApplication.class, args); SpringContextUt...原创 2019-06-13 14:07:26 · 4432 阅读 · 0 评论 -
spring boot 获取自定义注解上的参数值
纯笔记注解:MyAnnotationpackage com.example.demo;import java.lang.annotation.ElementType;import java.lang.annotation.Retention;import java.lang.annotation.RetentionPolicy;import java.lang.annotat...原创 2019-06-26 20:41:09 · 9857 阅读 · 1 评论 -
elasticsearch纯笔记
package com.example.demoes0.bean;import lombok.Data;import org.springframework.data.annotation.Id;import org.springframework.data.elasticsearch.annotations.Document;import org.springframework.da...原创 2019-06-30 21:31:02 · 231 阅读 · 0 评论 -
Springboot RabbitMQ
pom.xml<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-amqp</artifactId></dependency>application.ymlspring: ...原创 2019-07-30 16:47:09 · 120 阅读 · 0 评论 -
java鬼混笔记:springboot之thymeleaf 6:内联模式
thymeleaf内联thymeleaf内联 报错 实体名称必须紧跟在 '&' 后面 解决方法原创 2017-11-23 22:47:32 · 1541 阅读 · 0 评论 -
java鬼混笔记:springboot 10、springboot logback-spring.xml简单的日志配置
在src/main/resources下创建一个logback-spring.xml,内容如下<?xml version="1.0" encoding="UTF-8"?><configuration> <property name="LOG_PATH" value="E://logs/" /> <!--控制台输原创 2017-11-25 14:33:21 · 343 阅读 · 0 评论 -
java鬼混笔记:springboot 9、springboot整合mybatis加上分页功能
springboot整合mybatis加上分页功能springboot调用pagehelper分页功能原创 2017-10-29 20:32:19 · 399 阅读 · 0 评论 -
java鬼混笔记:springboot 7、springboot整合mybatis后再加上druid数据库连接池
springboot+mybatis+druid原创 2017-10-21 23:23:04 · 734 阅读 · 0 评论 -
java鬼混笔记:springboot 4、springboot热部署
springboot热部署springboot热部署没效果原创 2017-10-15 18:28:09 · 377 阅读 · 0 评论 -
java鬼混笔记:springboot 2、springboot修改访问端口
springboot修改访问端口原创 2017-10-15 17:49:06 · 371 阅读 · 0 评论 -
java鬼混笔记:springboot 5、springboot的Scheduled定时器:fixedDelay和fixedRate区别
springboot的Scheduled定时器springboot的fixedDelay和fixedRate区别原创 2017-10-15 21:44:16 · 11778 阅读 · 0 评论 -
java鬼混笔记:springboot 8、springboot发邮件mail
springboot整合mail发邮件原创 2017-10-24 22:35:04 · 464 阅读 · 0 评论 -
java鬼混笔记:springboot 3、springboot创建web项目和打包
springboot 创建web项目springboot Web项目打包原创 2017-10-15 18:19:18 · 621 阅读 · 0 评论 -
java鬼混笔记:springboot之thymeleaf 1:简单的thymeleaf例子
springboot thymeleaf原创 2017-11-17 23:01:11 · 632 阅读 · 0 评论 -
java鬼混笔记:springboot之thymeleaf 2:字符串Strings常见的使用方法
thymeleaff的strings常用方法原创 2017-11-17 23:56:31 · 5672 阅读 · 0 评论 -
java鬼混笔记:springboot之thymeleaf 3:th:each遍历
thymeleaf th:each 循环遍历原创 2017-11-18 14:58:24 · 44316 阅读 · 0 评论 -
java鬼混笔记:springboot之thymeleaf 4:常见的格式化方法
thymeleaf常见的格式化方法原创 2017-11-20 22:06:31 · 5760 阅读 · 0 评论 -
java鬼混笔记:springboot之thymeleaf 5:模板引入与删除代码
thymeleaf模板引入thymeleaf 删除代码原创 2017-11-23 22:25:19 · 427 阅读 · 0 评论 -
java鬼混笔记:springboot 6、springboot整合mybatis(支持多数源)
springboot整合mybatisspringboot整合mybatis支持多数据源原创 2017-10-21 20:18:03 · 1020 阅读 · 0 评论