KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Which is more correct? This (with the @Autowired annotation on the method)? @Controller public class MyController { private MyDao myDao; @Autowired public MyController(MyDao myDao) { this.myDao = myDao; } This (with the @Autowired annotation on the property)? @Controller public class MyController { @Autowired private MyDao myDao; public MyController(MyDao myDao) { this.myDao = myDao; } Where is the @Autowired annotation supposed to go?
Tags (comma-separated)
Save Edits
Cancel