Browse Source

Polishing

pull/22500/head
Sam Brannen 6 years ago
parent
commit
abda6a6c66
  1. 5
      spring-web/src/main/java/org/springframework/web/context/support/RequestHandledEvent.java
  2. 11
      spring-webmvc/src/test/java/org/springframework/web/servlet/ComplexWebApplicationContext.java

5
spring-web/src/main/java/org/springframework/web/context/support/RequestHandledEvent.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2018 the original author or authors.
* Copyright 2002-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -24,8 +24,7 @@ import org.springframework.lang.Nullable; @@ -24,8 +24,7 @@ import org.springframework.lang.Nullable;
*
* <p>Supported by Spring's own FrameworkServlet (through a specific
* ServletRequestHandledEvent subclass), but can also be raised by any
* other web component. Used, for example, by Spring's out-of-the-box
* PerformanceMonitorListener.
* other web component.
*
* @author Rod Johnson
* @author Juergen Hoeller

11
spring-webmvc/src/test/java/org/springframework/web/servlet/ComplexWebApplicationContext.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -33,7 +33,6 @@ import org.springframework.beans.BeansException; @@ -33,7 +33,6 @@ import org.springframework.beans.BeansException;
import org.springframework.beans.MutablePropertyValues;
import org.springframework.beans.factory.config.RuntimeBeanReference;
import org.springframework.beans.factory.support.ManagedList;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.context.support.ApplicationObjectSupport;
@ -519,15 +518,13 @@ public class ComplexWebApplicationContext extends StaticWebApplicationContext { @@ -519,15 +518,13 @@ public class ComplexWebApplicationContext extends StaticWebApplicationContext {
}
public static class TestApplicationListener implements ApplicationListener<ApplicationEvent> {
public static class TestApplicationListener implements ApplicationListener<RequestHandledEvent> {
public int counter = 0;
@Override
public void onApplicationEvent(ApplicationEvent event) {
if (event instanceof RequestHandledEvent) {
this.counter++;
}
public void onApplicationEvent(RequestHandledEvent event) {
this.counter++;
}
}

Loading…
Cancel
Save