- 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: [/*]
推薦閱讀
- 數(shù)據(jù)存儲架構與技術
- 數(shù)據(jù)挖掘原理與實踐
- Access 2016數(shù)據(jù)庫教程(微課版·第2版)
- 從零開始學Hadoop大數(shù)據(jù)分析(視頻教學版)
- Access 2007數(shù)據(jù)庫應用上機指導與練習
- 信息學競賽寶典:數(shù)據(jù)結構基礎
- 高維數(shù)據(jù)分析預處理技術
- 實用數(shù)據(jù)結構
- Doris實時數(shù)倉實戰(zhàn)
- 數(shù)據(jù)挖掘競賽實戰(zhàn):方法與案例
- Filecoin原理與實現(xiàn)
- 數(shù)據(jù)庫原理及應用實驗:基于GaussDB的實現(xiàn)方法
- Kafka權威指南(第2版)
- 機器視覺原理與案例詳解
- Learning Game AI Programming with Lua