Results 1 to 2 of 2

Thread: Difference between

  1. #1
    Join Date
    Apr 2005
    Posts
    1

    Default Difference between
    Hi All,

    In the code above, createInstance method of batchFilePathVarFactory is never called when I get "readBatchIdAction" instance. The "filePath" property is java.lang.String and it's initialized by "batchFilePath" contant :shock:.
    But if I change "idref" to "ref" everything starts to work as planned.

    Can somebody explain the difference, or may be it just a bug?

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http&#58;//www.springframework.org/dtd/spring-beans.dtd">
    
    <beans>
    
       <bean id="batchFilePathVarFactory"
          class="com.VariableFactory">
       </bean>
    
       <bean id="batchFilePath" factory-bean="batchFilePathVarFactory"
          factory-method="createInstance" singleton="false" />
    
       <bean id="readBatchIdAction"
          class="com.ReadBatchId"
          singleton="false">
          <property name="filePath">
             <idref local="batchFilePath"/>
          </property>
       </bean>
    
    </beans>
    Thanks


  2. #2
    Join Date
    Mar 2005
    Location
    San Francisco, CA
    Posts
    114

    Default

    This isn't a bug, it is working as expected. "ref" is used to pass the bean that the ref refers to. "idref" is used to pass the name of the bean (as a String) that is referred to.

Similar Threads

  1. Replies: 2
    Last Post: Aug 15th, 2005, 11:06 PM
  2. Replies: 5
    Last Post: Jul 15th, 2005, 01:21 PM
  3. Replies: 4
    Last Post: Mar 9th, 2005, 09:13 AM
  4. Replies: 2
    Last Post: Jan 13th, 2005, 09:57 AM
  5. Replies: 5
    Last Post: Sep 15th, 2004, 08:06 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
  •