views:

38

answers:

1

I am trying to use autowire="autodetect"..

In eclipse code suggest does not show me autodetect as the option..But it shows other values like byname,bytype,constructor..

whats missing in my application?

+3  A: 

It's not offering you autodetect because (according to the documentation), autodetect isn't an option. The valid options are byName, byType amd constructor.

Incidentally, this kind of autowiring is seriously old-fashioned. The annotations @Autowired and @Inject offer much better control over autowiring - see docs.

update: The autodetect option was deprecated as of Spring 3.x, and so it no longer appears in the documentation. It should still work, however (see the javadoc), so I was wrong to originally say that it wasn't an option.

skaffman
Yes u r right..i checked it and there is no option given...Actually i am going through the Spring in Action third edition book and in that the author explains about this option...And also on this site http://www.mkyong.com/spring/spring-auto-wiring-beans-in-xml/he discussed about this option..was it available in 2.5?
javanoob
@javanerd: See updated answer.
skaffman
Thanks alot for looking into my question and clearing my doubt..i think i need to learn looking into the issue deaper..
javanoob
@javanerd: `@Autowired` rocks.
skaffman