Merge branch '5.1.x'

This commit is contained in:
Sam Brannen
2019-03-13 15:16:24 +01:00
13 changed files with 81 additions and 83 deletions

View File

@@ -1692,14 +1692,14 @@ you can use the `and`, `or`, and `not` keywords in place of `&&`, `||`, and `!`,
respectively. For example, the previous pointcut can be better written as follows:
[source,xml,indent=0]
[subs="verbatim,quotes"]
[subs="verbatim"]
----
<aop:config>
<aop:aspect id="myAspect" ref="aBean">
<aop:pointcut id="businessService"
expression="execution(* com.xyz.myapp.service.*.*(..)) **and** this(service)"/>
expression="execution(* com.xyz.myapp.service.*.*(..)) and this(service)"/>
<aop:before pointcut-ref="businessService" method="monitor"/>
@@ -3122,7 +3122,7 @@ the following example:
class="foo.StubEntitlementCalculationService"/>
<!-- this switches on the load-time weaving -->
**<context:load-time-weaver/>**
<context:load-time-weaver/>
</beans>
----

View File

@@ -810,7 +810,7 @@ use the `NamespaceHandlerSupport` class:
public class MyNamespaceHandler extends NamespaceHandlerSupport {
public void init() {
**registerBeanDefinitionParser("dateformat", new SimpleDateFormatBeanDefinitionParser());**
registerBeanDefinitionParser("dateformat", new SimpleDateFormatBeanDefinitionParser());
}
}

View File

@@ -2656,7 +2656,7 @@ to do so:
[source,java,indent=0]
[subs="verbatim,quotes"]
----
**@RequestScope**
@RequestScope
@Component
public class LoginAction {
// ...
@@ -2692,7 +2692,7 @@ When using annotation-driven components or Java configuration, you can use the
[source,java,indent=0]
[subs="verbatim,quotes"]
----
**@SessionScope**
@SessionScope
@Component
public class UserPreferences {
// ...
@@ -2727,7 +2727,7 @@ following example shows how to do so:
[source,java,indent=0]
[subs="verbatim,quotes"]
----
**@ApplicationScope**
@ApplicationScope
@Component
public class AppPreferences {
// ...
@@ -4615,7 +4615,7 @@ primary `MovieCatalog`:
public class MovieConfiguration {
@Bean
**@Primary**
@Primary
public MovieCatalog firstMovieCatalog() { ... }
@Bean
@@ -4656,7 +4656,7 @@ The corresponding bean definitions follow:
<context:annotation-config/>
<bean class="example.SimpleMovieCatalog" **primary="true"**>
<bean class="example.SimpleMovieCatalog" primary="true">
<!-- inject any dependencies required by this bean -->
</bean>
@@ -4687,7 +4687,7 @@ shown in the following example:
public class MovieRecommender {
@Autowired
**@Qualifier("main")**
@Qualifier("main")
private MovieCatalog movieCatalog;
// ...
@@ -4707,7 +4707,7 @@ method parameters, as shown in the following example:
private CustomerPreferenceDao customerPreferenceDao;
@Autowired
public void prepare(**@Qualifier("main")**MovieCatalog movieCatalog,
public void prepare(@Qualifier("main") MovieCatalog movieCatalog,
CustomerPreferenceDao customerPreferenceDao) {
this.movieCatalog = movieCatalog;
this.customerPreferenceDao = customerPreferenceDao;
@@ -4823,7 +4823,7 @@ provide the `@Qualifier` annotation within your definition, as the following exa
----
@Target({ElementType.FIELD, ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
**@Qualifier**
@Qualifier
public @interface Genre {
String value();
@@ -4839,13 +4839,13 @@ following example shows:
public class MovieRecommender {
@Autowired
**@Genre("Action")**
@Genre("Action")
private MovieCatalog actionCatalog;
private MovieCatalog comedyCatalog;
@Autowired
public void setComedyCatalog(**@Genre("Comedy")** MovieCatalog comedyCatalog) {
public void setComedyCatalog(@Genre("Comedy") MovieCatalog comedyCatalog) {
this.comedyCatalog = comedyCatalog;
}
@@ -4875,12 +4875,12 @@ demonstrates both approaches:
<context:annotation-config/>
<bean class="example.SimpleMovieCatalog">
**<qualifier type="Genre" value="Action"/>**
<qualifier type="Genre" value="Action"/>
<!-- inject any dependencies required by this bean -->
</bean>
<bean class="example.SimpleMovieCatalog">
**<qualifier type="example.Genre" value="Comedy"/>**
<qualifier type="example.Genre" value="Comedy"/>
<!-- inject any dependencies required by this bean -->
</bean>
@@ -5179,7 +5179,7 @@ named `movieFinder` injected into its setter method:
private MovieFinder movieFinder;
**@Resource**
@Resource
public void setMovieFinder(MovieFinder movieFinder) {
this.movieFinder = movieFinder;
}
@@ -5381,7 +5381,7 @@ You can then use `@SessionScope` without declaring the `proxyMode` as follows:
[subs="verbatim,quotes"]
----
@Service
**@SessionScope**
@SessionScope
public class SessionScopedService {
// ...
}
@@ -5393,7 +5393,7 @@ You can also override the value for the `proxyMode`, as the following example sh
[subs="verbatim,quotes"]
----
@Service
**@SessionScope(proxyMode = ScopedProxyMode.INTERFACES)**
@SessionScope(proxyMode = ScopedProxyMode.INTERFACES)
public class SessionScopedUserService implements UserService {
// ...
}
@@ -5896,7 +5896,7 @@ technique:
[subs="verbatim,quotes"]
----
@Component
**@Qualifier("Action")**
@Qualifier("Action")
public class ActionMovieCatalog implements MovieCatalog {
// ...
}
@@ -5906,7 +5906,7 @@ technique:
[subs="verbatim,quotes"]
----
@Component
**@Genre("Action")**
@Genre("Action")
public class ActionMovieCatalog implements MovieCatalog {
// ...
}
@@ -5916,7 +5916,7 @@ technique:
[subs="verbatim,quotes"]
----
@Component
**@Offline**
@Offline
public class CachingMovieCatalog implements MovieCatalog {
// ...
}
@@ -6782,7 +6782,7 @@ as the following example shows:
public class MyConfiguration {
@Bean
**@Scope("prototype")**
@Scope("prototype")
public Encryptor encryptor() {
// ...
}
@@ -6808,7 +6808,7 @@ it resembles the following:
----
// an HTTP Session-scoped bean exposed as a proxy
@Bean
**@SessionScope**
@SessionScope
public UserPreferences userPreferences() {
return new UserPreferences();
}
@@ -6883,7 +6883,7 @@ annotation, as the following example shows:
public class AppConfig {
@Bean
**@Description("Provides a basic example of a bean")**
@Description("Provides a basic example of a bean")
public Thing thing() {
return new Thing();
}
@@ -7674,7 +7674,7 @@ can rewrite the `dataSource` configuration as follows:
[subs="verbatim,quotes"]
----
@Configuration
**@Profile("development")**
@Profile("development")
public class StandaloneDataConfig {
@Bean
@@ -7692,7 +7692,7 @@ can rewrite the `dataSource` configuration as follows:
[subs="verbatim,quotes"]
----
@Configuration
**@Profile("production")**
@Profile("production")
public class JndiDataConfig {
@Bean(destroyMethod="")
@@ -7731,7 +7731,7 @@ of creating a custom composed annotation. The following example defines a custom
----
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
**@Profile("production")**
@Profile("production")
public @interface Production {
}
----
@@ -7952,7 +7952,7 @@ following example:
[subs="verbatim,quotes"]
----
@Configuration
**@Profile("default")**
@Profile("default")
public class DefaultDataConfig {
@Bean
@@ -8063,7 +8063,7 @@ a call to `testBean.getName()` returns `myTestBean`:
[subs="verbatim,quotes"]
----
@Configuration
**@PropertySource("classpath:/com/myco/app.properties")**
@PropertySource("classpath:/com/myco/app.properties")
public class AppConfig {
@Autowired

View File

@@ -678,7 +678,7 @@ implementation of an `initBinder(..)` method:
protected void initBinder(HttpServletRequest request,
ServletRequestDataBinder binder) throws Exception {
**this.customPropertyEditorRegistrar.registerCustomEditors(binder);**
this.customPropertyEditorRegistrar.registerCustomEditors(binder);
}
// other methods to do with registering a User