Announcement Announcement Module
Collapse
No announcement yet.
Referencing bean in other XML file Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Referencing bean in other XML file

    I have two configuration files, applicationContext.xml and dispatcher-servlet.xml. I'm referencing a bean defined in one file from the other. I'm using the "ref bean=" syntax (not local). Anything else I need to do to get this to work? The stack trace is telling me that it can't resolve the reference and then listing out all the bean names defined locally (as if that is the only place it's looking).

    applicationContext.xml
    <bean id="bean1" class="...
    </bean>

    dispatcher-servlet.xml:
    <bean id="bean2" class="...
    <property name="b1"><ref bean="bean1"/></property>
    </bean>

  • #2
    how do you load your applicationContext.xml?

    Comment


    • #3
      Well, I'm not. And that just could be the problem. ;-) Seriously, your question pointed me to the right part of the doc to review. thanks.

      Comment

      Working...
      X