官术网_书友最值得收藏!

How to do it...

  1. 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(); 
    } 
} 
  1. Start the application by running ./gradlew clean bootRun.
  2. In the startup log, we should see the following line, indicating that our filter has been added:
...FilterRegistrationBean : Mapping filter: 'remoteIpFilter' to: [/*]
主站蜘蛛池模板: 诸暨市| 贵港市| 芜湖县| 吉安市| 偏关县| 大城县| 华宁县| 内黄县| 舒兰市| 商南县| 北海市| 饶河县| 柳江县| 安龙县| 乐陵市| 玛曲县| 固安县| 安远县| 临武县| 嵩明县| 搜索| 婺源县| 偃师市| 炉霍县| 富蕴县| 佛教| 东台市| 桐柏县| 彩票| 南华县| 汉阴县| 华坪县| 确山县| 海安县| 依兰县| 柳河县| 城固县| 柳江县| 陈巴尔虎旗| 阳信县| 南皮县|