How can I inject handler into a annotation controller(@Controller) without using @Autowire?
How can I inject handler into a annotation controller( @Controller ) without using @Autowire
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can of course always configure autowiring in XML:
But you will probably have to supply Setter methods for the properties.
Reference: Autowiring Collaborators
BTW, you can also use the JSR-250
@Resourceannotation (and of course JSR-330’s@Inject, thanks @Bozho) if you don’t want to use Spring’s proprietary@Autowiredannotation.Reference:
@Resource,@Autowiredand@Inject