Title: Adding a Custom Application Context Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at . http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 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](rave-extensions.html) for an example overlay. ##2) Create a new Spring context XML file Define a Spring context file in accordance with the [Spring Documentation](http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/beans.html). 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 `` element in the `contextConfigLocation` context param in the now overridden web.xml. contextConfigLocation /WEB-INF/applicationContext.xml /WEB-INF/dataContext.xml /WEB-INF/applicationContext-security.xml ##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.