listPerson is called to list the users, so they need the model object containing the users to display in the front end, so model object is used, in case of removePerson, there is no need of model object, so they are not using it.
posted 5 years ago
There is a use of @Qualifier annotation in the controller. When I remove that, I get an error:
No qualifying bean of type [com.journaldev.spring.service.PersonService] is defined: expected single matching bean but found 2: personService,personServiceImpl
Now both personService and personService are interface and corresponding implementing class respectively. Why would it give error on that?
I can understand if there are two beans defined for the same class with different ids, but that is not the case.
You have a @Service annotation on the PersonServiceImpl class. This means that spring will create an instance of PersonServiceImpl. You also have a PersonServiceImpl declared in your spring XML. THis creates another instance of PersonServiceImpl. SO, you have 2 instances of PersonServiceImpl
Could you hold this puppy for a sec? I need to adjust this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!