对IoC容器和Bean的学习笔记

本书作者:测试开发刚哥,文章版权归个人所有,未经授权请勿转载。 What We Mean by “Spring” The term “Spring” means different things in different contexts. It can be used to refer to the Spring Framework project itself, which is where it all started. Over time, other Spring projects have been built on top of the Spring Framework. Most often, when people say “Spring”, they mean the entire family of projects. This reference documentation focuses on the foundation: the Spring Framework itself. ...

SpringBoot官方笔记8其他

本书作者:测试开发刚哥,文章版权归个人所有,未经授权请勿转载。 Container Images FROM eclipse-temurin:17-jre as builder WORKDIR application ARG JAR_FILE=target/*.jar COPY ${JAR_FILE} application.jar RUN java -Djarmode=layertools -jar application.jar extract FROM eclipse-temurin:17-jre WORKDIR application COPY --from=builder application/dependencies/ ./ COPY --from=builder application/spring-boot-loader/ ./ COPY --from=builder application/snapshot-dependencies/ ./ COPY --from=builder application/application/ ./ ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher"] $ docker build --build-arg JAR_FILE=path/to/myapp.jar . Production-ready Features The spring-boot-actuator module provides all of Spring Boot’s production-ready features. <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency> </dependencies> Endpoints Actuator endpoints let you monitor and interact with your application. Spring Boot includes a number of built-in endpoints and lets you add your own. For example, the health endpoint provides basic application health information. ...

SpringBoot官方笔记7IO

本书作者:测试开发刚哥,文章版权归个人所有,未经授权请勿转载。 Caching Spring Boot auto-configures the cache infrastructure as long as caching support is enabled by using the @EnableCaching annotation. import org.springframework.cache.annotation.Cacheable; import org.springframework.stereotype.Component; @Component public class MyMathService { @Cacheable("piDecimals") public int computePiDecimal(int precision) { ... } } Before invoking computePiDecimal, the abstraction looks for an entry in the piDecimals cache that matches the i argument. If an entry is found, the content in the cache is immediately returned to the caller, and the method is not invoked. Otherwise, the method is invoked, and the cache is updated before returning the value. ...

SpringBoot官方笔记6消息

The Spring Framework provides extensive support for integrating with messaging systems, from simplified use of the JMS API using JmsTemplate to a complete infrastructure to receive messages asynchro

SpringBoot官方笔记5Data

Spring Boot integrates with a number of data technologies, both SQL and NoSQL.

SpringBoot官方笔记4Web

Most web applications use the spring-boot-starter-web module to get up and running quickly. You can also choose to build reactive web applications by using the spring-boot-starter-webflux module.

SpringBoot官方笔记3核心

本书作者:测试开发刚哥,文章版权归个人所有,未经授权请勿转载。 SpringApplication By default, INFO logging messages are shown, including some relevant startup details, such as the user that launched the application. Lazy Initialization When lazy initialization is enabled, beans are created as they are needed rather than during application startup. spring.main.lazy-initialization=true @Lazy(false) annotation:disable lazy initialization for certain beans Customizing the Banner adding a banner.txt file to your classpath or by setting the spring.banner.location property to the location of such a file. If the file has an encoding other than UTF-8, you can set spring.banner.charset. ...

SpringBoot官方笔记2使用

本书作者:测试开发刚哥,文章版权归个人所有,未经授权请勿转载。 Build Systems 选择Maven or Gradle,而不要Ant(not particularly well supported) In practice, you do not need to provide a version for any of these dependencies (spring-boot-dependencies) in your build configuration, as Spring Boot manages that for you. When you upgrade Spring Boot itself, these dependencies are upgraded as well in a consistent way. Each release of Spring Boot is associated with a base version of the Spring Framework. Starters are a set of convenient dependency descriptors that you can include in your application. ...

SpringBoot官方笔记1入门

Spring Boot helps you to create stand-alone, production-grade Spring-based applications that you can run. Most Spring Boot applications need very little Spring configuration.

关于SpringBoot开发的更多细节

在上篇文章《开发你的第一个SpringBoot应用》已经对SpringBoot基本开发流程有了大体了解,本文将继续对SpringBoot官网进行学习,发现关于SpringBoot开发的更多细节。