- Mastering Spring Boot 2.0
- Dinesh Rajput
- 348字
- 2021-06-25 21:29:14
Customizing Auto-Configuration in Spring Boot Application
Spring Boot gives us a free hand when it comes to overriding auto-configurations in each module. It doesn't force us to use default configurations. It is very opinionated about the configurations. In this chapter, we will explore how to override auto-configurations using properties and YML files.
Some days ago, one of my friends purchased a car. You know that car companies also provide full control of exterior decoration to make it look like a sports car. You could change the color combination, headlights, wheels, door LEDs, and so on. The car can be changed according to your precise specifications.
But on the other hand, most models of car can't be overridden. You have to purchase them with auto-configuration. Some car companies offer a form of auto-configuration so, you don't have to explicitly specify the colors of the external and internal body. Either the companies already applied the color customization within offers, or they will not give you a hand when choosing the body color.
Most of the cars or car companies will let you customize your car, so that you can purchase a pre-configured car with default configuration. Similarly, if you are working with a traditional Spring configuration, you have full control over what goes into your Spring configuration, much like purchasing a car and explicitly specifying all of the features you want.
On the other hand, Spring Boot auto-configuration is like purchasing a car on offer. It's easier to let Spring Boot handle the details than to declare each and every bean in the application's context. Fortunately, Spring Boot auto-configuration is flexible. Spring Boot will let you step in and influence how it applies auto-configuration.
At the end of this chapter, you will understand how Spring Boot provides flexibility to override auto-configuration by using explicit configuration overrides and fine-grained configuration with properties.
This chapter will cover the following points:
- Understanding auto-configuration
- Customizing Spring Boot
- Overriding the auto-configuration of Spring Boot
- Externalizing configuration with properties
- Fine-tuning with logging
- Using YAML for configuration
- Customizing application error pages
Let's see these topics in detail.
- 從原始數據到分析報告:Excel數據透視表高效達人養成記
- 漫!動作!人體動態漫畫素描技法超級大全
- 新手易學:電腦辦公
- 遠程辦公效率手冊
- Excel 2019公式、函數應用大全
- Excel高效數據處理分析:效率是這樣煉成的!
- Access 2010數據庫實用教程
- Excel+PPT+Word+PS+短視頻剪輯+PDF+思維導圖+居家辦公+辦公設備9合1
- 新編Word/Excel/PPT 2016高效辦公三合一(全彩版)
- 從零開始學Excel VBA
- Word/Excel/PowerPoint三合一應用大全
- Word/Excel/PPT 2016辦公應用從入門到精通
- Excel 2010高效辦公:會計實務與財務管理
- 電腦辦公從新手到高手(超值版)
- PPT現代商務辦公從新手到高手:讓你的PPT更有說服力