In a spring configuration, what is the difference between using name vs id? I'm aware that XML restricts the "id" attribute to be unique in a document and limits the characters for using in the id. But otherwise when declaring a bean, what is the difference between using the "name" attribute vs the "id" attribute?
views:
555answers:
2
+2
A:
Essentially, this is really just a XML matter. But you can also use the name attribute to specify aliases for a bean using characters which would be illegal in an id, I think.
cretzel
2008-10-17 13:53:57
+1
A:
In general, you should try to use id instead of name when you can. That way, the parser can catch duplicates for you.
lowellk
2008-10-28 06:12:31