facebook

Support for multiple Spring appContext files

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #236114 Reply

    LathamJohnP
    Member

    Hi,

    I installed 4.0GA, and looked at the new Spring capabilities. They are very close to very useful, but for one thing – no support for multiple applicationContext files.

    It is not unusual to break up large Spring configurations into multiple files – I have one for my core beans, one for Spring-managed Struts actions, and one for acegi.

    Although the “add spring support” wizard only allows a single file to be selected, the .springBeans file hints that this may be possible – I can set it to:

    <configs>
    <config>web/WEB-INF/applicationContext-business.xml</config>
    <config>web/WEB-INF/applicationContext-struts.xml</config>
    <config>web/WEB-INF/applicationContext.acegi-security.xml</config>
    </configs>

    But I get validation errors because the plugin can’t resolve non-local bean references.

    I also tried using a composite file with XInclude:

    <?xml version=”1.0″ encoding=”UTF-8″?>
    <beans xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance&#8221;
    xmlns:xi=”http://www.w3.org/2001/XInclude&#8221;
    xsi:noNamespaceSchemaLocation=”spring-beans.xsd”>
    <import resource=”applicationContext-acegi-security.xml”/>
    <import resource=”applicationContext-business.xml”/>
    <import resource=”applicationContext-struts.xml”/>
    </beans>

    This file validates OK, even when there are intentional errors.

    So, assuming I haven’t missed anything, it looks like multiple-file support is planned but incomplete 🙂

    John Latham

    #236165 Reply

    Riyad Kalla
    Member

    John,
    If you right click on your project root, go to Properties > MyEclipse-Spring, you can click Add to add your spring config files here.

    #238470 Reply

    dlread
    Member

    rkalla wrote:

    If you right click on your project root, go to Properties > MyEclipse-Spring, you can click Add to add your spring config files here.

    This is true, but I’m finding John’s statement is also true.:

    But I get validation errors because the plugin can’t resolve non-local bean references.

    Even though you can specify multiple Spring config files, I’m finding that externally referenced beans (a bean defined in one config file but used in another config file) are erroneously being marked as validation errors.

    Is anybody else having this problem?

    MyEclipse Build: 20050829-4.0.0-GA
    Eclipse v3.1.0 Build: I20050627-1435

    -Lee-

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: Support for multiple Spring appContext files

You must be logged in to post in the forum log in