Announcement Announcement Module
Collapse
No announcement yet.
Difference between Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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.

    Comment

    Working...
    X