Browse Source

Polishing (backported from master)

pull/27107/head
Juergen Hoeller 5 years ago
parent
commit
43071109f7
  1. 4
      spring-webmvc/src/main/java/org/springframework/web/servlet/i18n/AcceptHeaderLocaleResolver.java
  2. 11
      src/docs/asciidoc/core/core-beans.adoc

4
spring-webmvc/src/main/java/org/springframework/web/servlet/i18n/AcceptHeaderLocaleResolver.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2020 the original author or authors.
* Copyright 2002-2021 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.
@ -72,7 +72,7 @@ public class AcceptHeaderLocaleResolver implements LocaleResolver { @@ -72,7 +72,7 @@ public class AcceptHeaderLocaleResolver implements LocaleResolver {
/**
* Configure a fixed default locale to fall back on if the request does not
* have an "Accept-Language" header.
* <p>By default this is not set in which case when there is "Accept-Language"
* <p>By default this is not set in which case when there is no "Accept-Language"
* header, the default locale for the server is used as defined in
* {@link HttpServletRequest#getLocale()}.
* @param defaultLocale the default locale to use

11
src/docs/asciidoc/core/core-beans.adoc

@ -10657,9 +10657,8 @@ architectures that build upon the well-known Spring programming model. @@ -10657,9 +10657,8 @@ architectures that build upon the well-known Spring programming model.
[[context-functionality-events-annotation]]
==== Annotation-based Event Listeners
As of Spring 4.2, you can register an event listener on any public method of a managed
bean by using the `@EventListener` annotation. The `BlockedListNotifier` can be rewritten as
follows:
You can register an event listener on any method of a managed bean by using the
`@EventListener` annotation. The `BlockedListNotifier` can be rewritten as follows:
[source,java,indent=0,subs="verbatim,quotes",role="primary"]
.Java
@ -10797,9 +10796,9 @@ method signature to return the event that should be published, as the following @@ -10797,9 +10796,9 @@ method signature to return the event that should be published, as the following
NOTE: This feature is not supported for
<<context-functionality-events-async, asynchronous listeners>>.
This new method publishes a new `ListUpdateEvent` for every `BlockedListEvent` handled by the
method above. If you need to publish several events, you can return a `Collection` of events
instead.
The `handleBlockedListEvent()` method publishes a new `ListUpdateEvent` for every
`BlockedListEvent` that it handles. If you need to publish several events, you can return
a `Collection` or an array of events instead.
[[context-functionality-events-async]]

Loading…
Cancel
Save