I want to use Spring to populate a list which will be used in a JSP. I don't want to store references to the individual beans (with id, etc), and fortunately I don't have to, the following works just fine, with merely the class being specified, and then the properties for each bean being assigned.
Where it comes unstuck is that I want to be able to specify a parent bean, containing some default properties so all the properties don't have to be specified each time. Thus I modify the above so I have:
<bean id="basicOption" class="sailingnetworks.web.ListViewSelectOption"/>
[default properties set]
and for each bean:
Now, though, when it is inheriting from a parent, I get the following error:
org.springframework.beans.factory.BeanDefinitionSt oreException: Error registering bean with name '' defined in file [/opt/projects/testing/listViewApplicationContext.xml]: Child bean definition has neither 'id' nor 'name'
So it only objects to not having an id or name when it is inheriting from a parent bean, which seems odd. I don't know whether this is a bug, or something I'm doing. It's with Spring 1.1.1.