In order for custom components to participate in or replace Apache Rave implementations, they must be made available to the Spring Application Context during application initialization. The simplest way to do this is to define a Spring context XML file that defines the custom beans to use.

Follow the steps below to create and add additional application contexts to Apache Rave:

1) Get Apache Rave

There are multiple ways to build your custom Apache Rave instance, but the quickest is to use a Maven WAR overlay. See Extending Rave for an example overlay.

2) Create a new Spring context XML file

Define a Spring context file in accordance with the Spring Documentation. Place the file in src/main/webapp/WEB-INF

3) Override web.xml

Copy the web.xml file from the Apache Rave source distribution (or exploded war) and place it in your overlay's src/main/webapp/WEB-INF directory.

4) Update web.xml

Add the location of your context XML file to the top of the <param-value> element in the contextConfigLocation context param in the now overridden web.xml.

<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>
        /WEB-INF/applicationContext.xml
        /WEB-INF/dataContext.xml
        /WEB-INF/applicationContext-security.xml
    </param-value>
</context-param>

5) Build and deploy your new Apache Rave war

Notes and concerns

This approach will work for overlays of rave-portal, rave-shindig or rave-wookie.

IF overriding a bean implementation with your own, the bean must be marked as primary. See the Spring documentation for discussion on primary beans.