Introduce 'value' alias for @Bean's 'name' attribute
In order to simplify configuration for use cases involving @Bean where only a bean name or aliases are supplied as an attribute, this commit introduces a new 'value' attribute that is an @AliasFor 'name' in @Bean. Issue: SPR-14728
This commit is contained in:
@@ -333,10 +333,10 @@ public class WebMvcConfigurationSupportTests {
|
||||
|
||||
|
||||
@EnableWebMvc
|
||||
@Configuration @SuppressWarnings("unused")
|
||||
@Configuration
|
||||
static class WebConfig {
|
||||
|
||||
@Bean(name="/testController")
|
||||
@Bean("/testController")
|
||||
public TestController testController() {
|
||||
return new TestController();
|
||||
}
|
||||
@@ -350,7 +350,7 @@ public class WebMvcConfigurationSupportTests {
|
||||
}
|
||||
|
||||
|
||||
@Configuration @SuppressWarnings("unused")
|
||||
@Configuration
|
||||
static class ViewResolverConfig {
|
||||
|
||||
@Bean
|
||||
@@ -387,7 +387,7 @@ public class WebMvcConfigurationSupportTests {
|
||||
}
|
||||
|
||||
|
||||
@Controller @SuppressWarnings("unused")
|
||||
@Controller
|
||||
private static class TestController {
|
||||
|
||||
@RequestMapping("/")
|
||||
@@ -413,7 +413,7 @@ public class WebMvcConfigurationSupportTests {
|
||||
|
||||
|
||||
@Controller
|
||||
@Scope(value="prototype", proxyMode=ScopedProxyMode.TARGET_CLASS)
|
||||
@Scope(scopeName = "prototype", proxyMode = ScopedProxyMode.TARGET_CLASS)
|
||||
static class ScopedProxyController {
|
||||
|
||||
@RequestMapping("/scopedProxy")
|
||||
|
||||
Reference in New Issue
Block a user