I have following when defining a constructor of a bean:
Why am I forced to name my bean (i'm calling it sf1).Code:<constructor-arg> <bean id="sf1" parent="default.sessionFactory"> <property name="dataSource"> <bean class="org.springframework.jndi.JndiObjectFactoryBean"> <property name="jndiName"> <value>java:comp/env/jdbc/ds</value> </property> </bean> </property> </bean> </constructor-arg>
However, if I don't use the parent and define the whole bean then I don't need to specify the id (ids for inner beans are meaningless).
I would like to treat these "inner beans" like annoymous classes where I don't need to specify ids since it should only exist in the inner portion of definition (i.e sf1 should never be accessible anywhere else).
dino


Reply With Quote