These are additional exercises you can try out once after learning and practicing all the previous exercises in this section. There will be also hints to make things easier.
Provide examples for autowire for type and autowire by construtcor following the note http://javajee.com/autowiring-in-spring-through-xml-configuration-example.
Rewrite the following programming using annotations and java configuration: http://javajee.com/autowiring-in-spring-through-xml-configuration-example.
Give examples for the usage of following annotations following the same example program in this section: @Autowired, @Resource, @Inject.
What will happen if I change a @Autowired annotation in the examples within the section with @Resource or @Inject?
Write a program that will fail without @Qualifier, but will pass once using @Qualifier.
Write a program that will fail without @Primary, but will pass once using @Primary.
Rewrite the following program using xml configuration: http://javajee.com/factory-beans-in-spring-using-annotations-example.
Useful bean attributes:
factory-method alone can be used to specify a getInstance method of the class to create the instance.
factory-bean and factory-method to specify a different factory class.
Print the bean definition count and the bean definition names for the following programs from within the main program and compare:
Rewrite this program using XML configuration: http://javajee.com/bean-scopes-in-spring-with-example
- You can submit your solutions for review and better ones may get added to the current section of notes. You will receive 1000 points for every accepted solution that feature on this site. If solutions are similar, winner will be decided on a first come basis. Please check first if the solution is already completed by anyone. Comment on this page once you send us the solution. You may also check with us upfront using the contact page before wotking on any solution to make sure noone else is working in parallel.
Searches whole web. Use the search in the right sidebar to search only within javajee.com!!!