Blog

  • 首页

  • 关于

  • 标签

  • 分类

  • 归档

  • 搜索

springboot-redis

发表于 2019-08-23 更新于 2019-08-24 分类于 SpringBoot
本文字数: 8.3k

环境搭建

依赖

1
2
3
4
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
1
2
3
4
5
6
7
@SpringBootApplication
@EnableCaching
public class SpringbootRedisApplication {
public static void main(String[] args) {
SpringApplication.run(SpringbootRedisApplication.class, args);
}
}
阅读全文 »

springboot-----cache

发表于 2019-08-21 更新于 2019-08-23 分类于 SpringBoot
本文字数: 9k

环境搭建

依赖

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-cache</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>2.1.0</version>
</dependency>

<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
阅读全文 »

springboot启动配置原理

发表于 2019-08-20 更新于 2019-08-23 分类于 SpringBoot
本文字数: 6.1k

启动类

1
2
3
4
5
6
7
@SpringBootApplication
public class SpringbootDay1Application {

public static void main(String[] args) {
SpringApplication.run(SpringbootDay1Application.class, args);
}
}

其中有一个@SpringBootApplication注解和SpringApplication.run(SpringbootDay1Application.class, args)方法。

阅读全文 »

SpringBoot自动装配--嵌入式Servlet容器

发表于 2019-08-18 分类于 SpringBoot
本文字数: 9.8k

简介

一般做Springboot项目,都是打成jar包,并且内嵌一个Servlet容器(Tomcat,jetty,undertow),今天就了解一下有关内嵌Servlet容器的自动装配(2.0.0版本),主要是两个类EmbeddedWebServerFactoryCustomizerAutoConfiguration和ServletWebServerFactoryAutoConfiguration

阅读全文 »

SpringBoot自动装配--ErrorMvcAutoConfiguration

发表于 2019-08-17 分类于 SpringBoot
本文字数: 7.1k

简介

Springboot项目在启动的时候,会自动装配一些常用的配置类(xxxAuoConfiguration),今天就来看一下和error有关的自动装配

ErrorMvcAutoConfiguration

1
2
3
4
5
6
7
@Configuration
@ConditionalOnWebApplication(type = Type.SERVLET)
@ConditionalOnClass({ Servlet.class, DispatcherServlet.class })
// Load before the main WebMvcAutoConfiguration so that the error View is available
@AutoConfigureBefore(WebMvcAutoConfiguration.class)
@EnableConfigurationProperties({ ServerProperties.class, ResourceProperties.class })
public class ErrorMvcAutoConfiguration {}
阅读全文 »
12345
麻辣香锅不要辣

麻辣香锅不要辣

21 日志
11 分类
20 标签
GitHub 简书
© 2019 – 2020 麻辣香锅不要辣 | 站点总字数: 20.4k字
|
0%