I thought I would be able to simplify my configurations slightly by using the nice new util:list syntax, so modified my context as follows...
Code:<bean id="virtualResource" class="fwk.versioning.VirtualResource" init-method="initialise" abstract="true"> </bean> <bean id="EmailSubmissionConfirmation" parent="virtualResource"> <property name="resourceName" value="EmailSubmissionConfirmation" /> <util:list id="resourceWrappers"> <bean class="fwk.versioning.VersionedResourceWrapper"> <property name="resource"> <bean class="print.templates.VelocityTemplateHolder"> <property name="templateName" value="templates/EmailSubmissionConfirmation.001.vm" /> </bean> </property> </bean> </util:list> </bean> <bean id="AssessmentLetterFlat" parent="virtualResource"> <property name="resourceName" value="AssessmentLetterFlat" /> <util:list id="resourceWrappers"> <bean class="fwk.versioning.VersionedResourceWrapper"> <property name="resource"> <bean class="print.templates.VelocityTemplateHolder"> <property name="templateName" value="templates/CNBSAssessmentLetterFlat.001.vm" /> </bean> </property> </bean> <bean class="fwk.versioning.VersionedResourceWrapper"> <property name="resource"> <bean class="print.templates.VelocityTemplateHolder"> <property name="templateName" value="templates/CNBSAssessmentLetterFlat2.001.vm" /> </bean> </property> </bean> </util:list> </bean>
As you can see, I have duplicate util:list ids of "resourceWrappers", which is the property of VirtualResource, so I cannot have different names. I had assumed that as it was declared within a bean definition, it would be local to that bean.
As it was rejected at runtime, is it only possible to do this with the (it has to be said, only slightly) more verbose...
Code:<property name="resourceWrappers"> <list> ...etc... </list> </property>
or have I missed a trick?
Kind regards


Reply With Quote