Make MetricFilter auto-configuration conditional on OncePerRequestFilter

In addition to requiring the Servlet API to be on the classpath,
MetricFilter requires spring-web to also be on the classpath as it
extends OncePerRequestFilter. This commit updates the auto-configuration
for MetricFilter so that it will be disabled in the absence of a 
dependency on spring-web.

Fixes gh-1664
pull/2035/head
Andy Wilkinson 10 years ago
parent d724c9062b
commit e90c8548a2

@ -52,7 +52,8 @@ import org.springframework.web.util.UrlPathHelper;
*/
@Configuration
@ConditionalOnBean({ CounterService.class, GaugeService.class })
@ConditionalOnClass({ Servlet.class, ServletRegistration.class })
@ConditionalOnClass({ Servlet.class, ServletRegistration.class,
OncePerRequestFilter.class })
@AutoConfigureAfter(MetricRepositoryAutoConfiguration.class)
public class MetricFilterAutoConfiguration {

Loading…
Cancel
Save