Pages

Spring Notes

Autowiring
1. Does setter injection (if an empty constructor was available). Constructor second.
2. By setting a class as @Component, the id is automatically the class name with the first letter in lower case. (e.g. Class Person Spring id is "person").
3. You can overwrite autowiring with xml files
4. Must have "context:component-scan base-package="package name" />" in the xml to tell Spring there are beans to scan
5. @Autowire wires by type, not by name

btemplates

0 comments:

Post a Comment