/** * Set the {@code Environment} that this component runs in. * * @param environment */ @Override publicvoidsetEnvironment(Environment environment) { log.info("cn.biuaxia.code.core.interceptor.AppStartupInterceptor.setEnvironment"); } }
/** * Add Spring MVC lifecycle interceptors for pre- and post-processing of * controller method invocations and resource handler requests. * Interceptors can be registered to apply to all requests or be limited * to a subset of URL patterns. * * @param registry 拦截器注册表 */ @Override publicvoidaddInterceptors(InterceptorRegistry registry) { Stringproperty= environment.getProperty("spring.datasource.url"); log.info("cn/biuaxia/code/core/interceptor/GlobalInterceptor.java:property: [{}]", property); WebMvcConfigurer.super.addInterceptors(registry); }
/** * Set the {@code Environment} that this component runs in. * * @param environment */ @Override publicvoidsetEnvironment(Environment environment) { Engine.environment = environment; }