PDA

View Full Version : Type of autowire used in the AbstractPathMapHandlerMapping



urubatan
Oct 25th, 2004, 01:31 PM
is there a reason to "autowire by type" be used instead of "autowire by name" in the AbstractPathMapHandlerMapping/CommonsPathMapHandlerMapping?
and it is verifying dependencies too, this is a problem if you want to map with attributes a MultiActionController
and is a problem too, when like in the application I'm working on, I have just one dao implementation (using Hibernate and QBE) and just a property in this dao specifies what class it should work with.

I solved my problem for now, changing the line 78 of AbstractPathMapHandlerMapping to:

Object handler = beanFactory.autowire(handlerClass, AutowireCapableBeanFactory.AUTOWIRE_BY_NAME, false);


what do you think about providing at least a configuration for this properties, so the user can choose the behavior of this class?

Rod Johnson
Nov 2nd, 2004, 03:16 AM
This is a good idea. Please raise an issue for this in JIRA, against 1.1.3, and I'll make the enhancement.

Good to see someone using that class: there doesn't seem to have been a lot of interest in it.

urubatan
Nov 2nd, 2004, 06:22 AM
just did it,
the same text as above, and the jira ID/link is:
http://opensource.atlassian.com/projects/spring/browse/SPR-442

I loved the idea of less XML for configuration :D