
SpringBoot
2Tree
专注后端开发
展开
-
Idea使用Docker部署SpringBoot项目
0、前言:Idea使用Docker部署SpringBoot项目1、基础环境:Mac、Idea、Java8、Docker、Maven2、新建一个springboot项目docker-demo-20212.1 pom文件,注意maven的docker-maven-plugin插件信息配置<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmln原创 2021-03-04 14:55:22 · 3062 阅读 · 3 评论 -
springboot小demo补脑ing
原创 2021-03-02 17:12:17 · 133 阅读 · 0 评论 -
springboot 配置keytool生成的自定义证书
一、使用keytool生成自己的tomcathttps.p12证书,名字可以随便取keytool -genkey -alias tomcathttps -keyalg RSA -keysize 2048-keystore tomcathttps.p12 -validity 365-genkey 表示要创建一个新的密钥-alias 表示keystore的别名-keyalg 表示使用的加密算法-keysize 密钥的长度-keystore 密钥存放的位置-validity 密钥..原创 2020-10-11 14:52:20 · 1145 阅读 · 2 评论 -
@SpringBootApplication注解
一、@SpringBootApplication是一个组合注解,加在项目启动类上。二、@SpringBootApplication定义:@SpringBootConfiguration@EnableAutoConfiguration@ComponentScan(excludeFilters = { @Filter(type = FilterType.CUSTOM, classes = TypeExcludeFilter.class), @Filter(type = FilterType.C原创 2020-10-11 13:11:34 · 2662 阅读 · 0 评论 -
SpringApplication的run方法主要代码步骤
一、图片流程图二、主要代码/** * Run the Spring application, creating and refreshing a new * {@link ApplicationContext}. * @param args the application arguments (usually passed from a Java main method) * @return a running {@link ApplicationContext} */.原创 2020-10-11 12:49:36 · 612 阅读 · 2 评论 -
@Configuration注解的proxyBeanMethods属性的作用
一、proxybeanMethods源码注释 /** * Specify whether {@code @Bean} methods should get proxied in order to enforce * bean lifecycle behavior, e.g. to return shared singleton bean instances even * in case of direct {@code @Bean} method calls in user code原创 2020-10-11 12:31:01 · 7093 阅读 · 6 评论 -
springboot整合fastjson,解决了中文乱码问题
1.排除spring-boot-starter-json依赖,添加fastjson依赖。<?xml version="1.0" encoding="UTF-8" ?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance...原创 2019-05-10 16:55:29 · 2735 阅读 · 0 评论 -
springboot把内嵌的tomcat容器改为jetty
1、排除spring-boot-starter-tomcat依赖<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <exclusions>...原创 2019-05-10 10:00:10 · 2156 阅读 · 1 评论 -
spring-boot项目读取配置文件优先级
spring-boot项目配置文件位置:1.项目根目录下config文件夹中的application.properties2.项目根目录下的application.properties3.项目classpath路径下的config文件夹中的application.properties4.项目classpath路径下的application.properties...原创 2019-05-09 14:30:42 · 826 阅读 · 0 评论 -
springboot-定制自己的banner
1.http://www.network-science.de/ascii/,访问此网址2.在spring-boot项目的resources目录下,创建banner.txt文件,把第一步生成复制到banner.txt文件中。3.启动项目,控制台输出如下。...原创 2019-05-09 13:58:03 · 408 阅读 · 0 评论 -
spring-boot-starter-parent的作用
一般我们创建springboot项目时,pom.xml一般都有下面这个配置,那它作用是什么?<parent><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-parent</artifactId&g...原创 2019-05-09 13:46:48 · 3659 阅读 · 0 评论 -
springboot-整合filter的两种方式
1.springboot通过扫描注解,@ServletComponentScan和@WebFilter实现1.1编写FirstFilter类实现Filter接口package com.zhong.spring_boot_filter_03.filter;import java.io.IOException;import javax.servlet.Filter;import j...原创 2019-06-13 13:44:57 · 15714 阅读 · 0 评论 -
springboot-HandlerMethodArgumentResolver解析自定义注解
1.自定义注解package com.zhong.spring_demo.anno;import java.lang.annotation.Documented;import java.lang.annotation.ElementType;import java.lang.annotation.Retention;import java.lang.annotation.Reten...原创 2019-06-12 13:04:47 · 2279 阅读 · 0 评论 -
springboot-自定义日志注解,使用AOP切面实现日志生成
1.自定义注解SysLogpackage com.zhong.spring_demo.anno;import java.lang.annotation.Documented;import java.lang.annotation.ElementType;import java.lang.annotation.Retention;import java.lang.annotatio...原创 2019-06-12 13:38:20 · 3252 阅读 · 0 评论 -
springboot-filter整合
1。编写MyFilter类,实现Filter接口package com.zhong.spring_demo.filter;import java.io.IOException;import javax.servlet.Filter;import javax.servlet.FilterChain;import javax.servlet.FilterConfig;import...原创 2019-06-12 13:41:16 · 241 阅读 · 0 评论 -
Idea修改Html不需重启Springboot项目生效设置
一、在pom中直接引入依赖spring-boot-devtools 1.在pom中直接引入依赖<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-devtools</artifactId><optional...原创 2019-10-09 11:17:39 · 784 阅读 · 2 评论 -
springboot项目启动3种方式
1.main()方法启动2.mvn spring-boot:run3.java -jar xxx.jar原创 2019-05-09 13:37:04 · 10172 阅读 · 0 评论 -
SpringBoot使用AspectJ为controller层添加日志功能
应用类编写:package com.zhong;import org.springframework.boot.SpringApplication;import org.springframework.boot.autoconfigure.SpringBootApplication;import org.springframework.context.annotation.En...原创 2019-03-15 16:13:22 · 3030 阅读 · 0 评论 -
Spring Boot - 使用类类型信息获取所有已加载的bean
Spring启动会在内部加载大量bean,以最少的配置运行您的应用程序。在这个例子中,我们将学习如何找出所有那些Spring boot加载的bean及其类类型信息。使用ApplicationContext获取所有已加载的bean要自动执行方法,当应用程序完全加载时,我正在使用CommandLineRunner接口。CommandLineRunner用于指示bean 在Spring应用程序中...翻译 2019-01-21 16:56:14 · 8790 阅读 · 0 评论 -
springboot之CommandLineRunner
Spring引导的CommandLineRunner接口用于在应用程序的生命周期中仅运行一次代码块 - 初始化应用程序之后。如何使用CommandLineRunner您可以通过CommandLineRunner三种方式使用界面:1)使用CommandLineRunner作为@Component这个很容易。 @Component public class Appli...翻译 2019-01-21 16:59:52 · 1592 阅读 · 0 评论 -
Springboot插件业务开发
https://blog.youkuaiyun.com/zhou8622/article/details/79389450https://blog.youkuaiyun.com/zhaocuit/article/details/83828476原创 2019-01-28 15:33:35 · 2689 阅读 · 2 评论