- Spring Boot 2.0 Cookbook(Second Edition)
- Alex Antonov
- 102字
- 2021-06-24 19:24:40
How to do it...
- It is a good idea to separate and group the configurations into different classes in order to provide more clarity about what kind of things are being configured. So, let's create a separate configuration class called WebConfiguration in the src/main/java/com/example/bookpub directory from the root of our project with the following content:
@Configuration public class WebConfiguration { @Bean public RemoteIpFilter remoteIpFilter() { return new RemoteIpFilter(); } }
- Start the application by running ./gradlew clean bootRun.
- In the startup log, we should see the following line, indicating that our filter has been added:
...FilterRegistrationBean : Mapping filter: 'remoteIpFilter' to: [/*]
推薦閱讀
- GitHub Essentials
- 大規模數據分析和建模:基于Spark與R
- Hands-On Machine Learning with Microsoft Excel 2019
- Java Data Science Cookbook
- Visual Studio 2015 Cookbook(Second Edition)
- Oracle RAC 11g實戰指南
- 大數據可視化
- 業務數據分析:五招破解業務難題
- 云計算與大數據應用
- 數據庫應用系統開發實例
- Augmented Reality using Appcelerator Titanium Starter
- SQL Server深入詳解
- 云計算寶典:技術與實踐
- Access 2010數據庫應用技術教程(第二版)
- 數據挖掘與數據化運營實戰:思路、方法、技巧與應用