Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce 'value' alias for @Bean's 'name' attribute [SPR-14728] #19293

Closed
spring-projects-issues opened this issue Sep 17, 2016 · 2 comments
Closed
Assignees
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

@spring-projects-issues spring-projects-issues commented Sep 17, 2016

Sam Brannen opened SPR-14728 and commented

Since use cases exist for which a user need only supply the name attribute for an @Bean method declaration, it would be beneficial to the user (in terms of usability) if the name could be supplied via an implicit value attribute.

For example, the following @Bean configuration for a Spring MVC controller that utilizes a BeanNameUrlHandlerMapping:

@Bean(name = "/testController")
TestController testController() {
	return new TestController();
}

... could be simplified as follows:

@Bean("/testController")
TestController testController() {
	return new TestController();
}

No further details from SPR-14728

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Sep 17, 2016

Sam Brannen commented

Resolved in: 8f62b63

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Sep 18, 2016

Juergen Hoeller commented

Since this is so straightforward and consistent with our general annotation alias wrap-up story in 4.3, I've backported it to 4.3.3 as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants