This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I am curious about your opinion regarding to the proper implementation/usage of DI in Spring MVC:
There are two classes: One Controller which works with a List (for dropdown menu) and there is an another Service class which carries the List elements from DB layer.
How would you inject Service into Contoller in Spring MVC?
Is there a way to inject DropDownService.getDropDownItems() elements into DropDownController.dropDownItems List through Dependency Injection in this case? If yes, then how ;-)
Actually, I am looking for the most sophisticated solution, for this reason I am curious about your opinion!
To me that is the easiest. I am also under the assumption that you see the typo in your DropDownSerivce class and that that class is defined in a Spring configuration, either with @Service or as a ><bean> in your xml.