Results 1 to 5 of 5

Thread: Why specify id with parent attribute in inner beans?

  1. #1
    Join Date
    Aug 2004
    Posts
    107

    Default Why specify id with parent attribute in inner beans?

    I have following when defining a constructor of a bean:

    Code:
     <constructor-arg>
          <bean id="sf1" parent="default.sessionFactory">
              <property name="dataSource">
                <bean class="org.springframework.jndi.JndiObjectFactoryBean">
                     <property name="jndiName">
                             <value>java&#58;comp/env/jdbc/ds</value>
                     </property>
                 </bean>
                </property>
           </bean>
    </constructor-arg>
    Why am I forced to name my bean (i'm calling it sf1).

    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

  2. #2
    Join Date
    Aug 2004
    Location
    Toronto, Canada
    Posts
    736

    Default

    Are you saying you're getting an error if you don't define the id ("sf1" in this case?). That shouldn't be the case. I would file a bug report if that's happening...
    Colin Sampaleanu
    SpringSource - http://www.springsource.com

  3. #3
    Join Date
    Aug 2004
    Posts
    107

    Default

    Hopefully, today I will write a small app with an xml file to reproduce this problem and submit a bug report.

    DIno

  4. #4
    Join Date
    Aug 2004
    Posts
    107

    Default

    How do I report this as a bug?

    dino

  5. #5
    Join Date
    Aug 2004
    Location
    Toronto, Canada
    Posts
    736

    Default

    In Spring's Jira instance:

    http://opensource.atlassian.com/proj...Dashboard.jspa

    Thanks,
    Colin Sampaleanu
    SpringSource - http://www.springsource.com

Similar Threads

  1. Hibernate Long Session Per Flow?
    By akw in forum Web Flow
    Replies: 21
    Last Post: Dec 12th, 2005, 08:06 PM
  2. Spring container fails with no exception
    By naor in forum Container
    Replies: 9
    Last Post: Oct 1st, 2005, 03:39 PM
  3. Replies: 1
    Last Post: Jul 28th, 2005, 05:08 PM
  4. stale Oracle processes
    By compostellas in forum Data
    Replies: 7
    Last Post: Jun 27th, 2005, 12:14 PM
  5. Replies: 2
    Last Post: Sep 5th, 2004, 10:49 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •