jQuery in Action, 2nd edition*
The moose likes Spring and the fly likes Spring Bean Collection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Spring Bean Collection" Watch "Spring Bean Collection" New topic
Author

Spring Bean Collection

Mark Reyes
Ranch Hand

Joined: Jul 09, 2007
Posts: 426
Hi,

I am currently reading the book spring recipes but I just encounter some problem which I cannot understand thoroughly.

It has a Java class that has List Collection as its instance variable.



Now in the book, it says that to supply values in the bean definition xml, we should make use of the <list> tag and so it is working.

But I tried to experiment a little and change the implementation to a <set> tag instead of a list. My expectation is that it will cause
some sort of classcastexception but it works fine and no error happens.



Because as I know both Set and List Interface inherits from the Collection Interface but I cant cast them to one another.

I am not sure if I miss something Spring basic or Java Basic.


Sean Clark ---> I love this place!!!
Me ------> I definitely love this place!!!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Spring Bean Collection
 
Similar Threads
Needs help for a simple AoP application with Spring
Class cast exception
Problem when Exception is thrown during EJB initialization
Needs help for AoP implementation with Spring
Spring config files inside jar