What is the best method to access Service Layer from Controller in Spring MVC? I'm using annotations for SpringMVC.
Earlier I used to get the bean everytime from the bean factory by calling ClassPathXMLApplicationContext(spring-bean-name.xml) in every method of controller.
From the solution to question Accessing Service Layer from custom Controller in Spring MVC I understand that service bean has to be autowired.
However suppose a controller accesses multiple services do we have to inject multiple beans? But that won't be a good practice cause we will have to use a particular service only in 1-2 methods within a controller and its not good to make it a class variable rather than a function variable.