You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by gn...@apache.org on 2006/10/30 21:18:26 UTC

svn commit: r469257 - in /incubator/servicemix/trunk/apache-servicemix-web: ./ src/ src/main/ src/main/java/ src/main/java/org/ src/main/java/org/apache/ src/main/java/org/apache/servicemix/ src/main/java/org/apache/servicemix/web/ src/main/java/org/ap...

Author: gnodet
Date: Mon Oct 30 12:18:25 2006
New Revision: 469257

URL: http://svn.apache.org/viewvc?view=rev&rev=469257
Log:
ServiceMix web app distribution.

Added:
    incubator/servicemix/trunk/apache-servicemix-web/   (with props)
    incubator/servicemix/trunk/apache-servicemix-web/pom.xml
    incubator/servicemix/trunk/apache-servicemix-web/src/
    incubator/servicemix/trunk/apache-servicemix-web/src/main/
    incubator/servicemix/trunk/apache-servicemix-web/src/main/java/
    incubator/servicemix/trunk/apache-servicemix-web/src/main/java/org/
    incubator/servicemix/trunk/apache-servicemix-web/src/main/java/org/apache/
    incubator/servicemix/trunk/apache-servicemix-web/src/main/java/org/apache/servicemix/
    incubator/servicemix/trunk/apache-servicemix-web/src/main/java/org/apache/servicemix/web/
    incubator/servicemix/trunk/apache-servicemix-web/src/main/java/org/apache/servicemix/web/http/
    incubator/servicemix/trunk/apache-servicemix-web/src/main/java/org/apache/servicemix/web/http/HttpComponentListener.java
    incubator/servicemix/trunk/apache-servicemix-web/src/main/java/org/apache/servicemix/web/http/HttpManagedServlet.java
    incubator/servicemix/trunk/apache-servicemix-web/src/main/resources/
    incubator/servicemix/trunk/apache-servicemix-web/src/main/webapp/
    incubator/servicemix/trunk/apache-servicemix-web/src/main/webapp/WEB-INF/
    incubator/servicemix/trunk/apache-servicemix-web/src/main/webapp/WEB-INF/servicemix.xml
    incubator/servicemix/trunk/apache-servicemix-web/src/main/webapp/WEB-INF/web.xml

Propchange: incubator/servicemix/trunk/apache-servicemix-web/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Mon Oct 30 12:18:25 2006
@@ -0,0 +1,4 @@
+.classpath
+.project
+.settings
+target

Added: incubator/servicemix/trunk/apache-servicemix-web/pom.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/apache-servicemix-web/pom.xml?view=auto&rev=469257
==============================================================================
--- incubator/servicemix/trunk/apache-servicemix-web/pom.xml (added)
+++ incubator/servicemix/trunk/apache-servicemix-web/pom.xml Mon Oct 30 12:18:25 2006
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    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.
+
+-->
+<project
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0">
+
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.servicemix</groupId>
+    <artifactId>servicemix</artifactId>
+    <version>3.1-incubating-SNAPSHOT</version>
+  </parent>
+
+  <artifactId>apache-servicemix-web</artifactId>
+  <packaging>war</packaging>
+  <name>ServiceMix :: WebApp distribution</name>
+  <description>WebApp distribution</description>
+
+  <dependencies>
+
+    <dependency>
+      <groupId>org.apache.servicemix</groupId>
+      <artifactId>servicemix-web-console</artifactId>
+      <version>3.1-incubating-SNAPSHOT</version>
+      <type>war</type>
+    </dependency>
+    <!--
+    <dependency>
+      <groupId>org.apache.xbean</groupId>
+      <artifactId>xbean-spring</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.xbean</groupId>
+      <artifactId>xbean-server</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.xbean</groupId>
+      <artifactId>xbean-kernel</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.xbean</groupId>
+      <artifactId>xbean-classloader</artifactId>
+      <version>${xbean-version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.geronimo.specs</groupId>
+      <artifactId>geronimo-j2ee-connector_1.5_spec</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.geronimo.specs</groupId>
+      <artifactId>geronimo-j2ee-management_1.0_spec</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.geronimo.specs</groupId>
+      <artifactId>geronimo-jta_1.0.1B_spec</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>wsdl4j</groupId>
+      <artifactId>wsdl4j</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>xstream</groupId>
+      <artifactId>xstream</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>stax</groupId>
+      <artifactId>stax-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>woodstox</groupId>
+      <artifactId>wstx-asl</artifactId>
+    </dependency>
+    -->
+    <dependency>
+      <groupId>javax.servlet</groupId>
+      <artifactId>servlet-api</artifactId>
+      <version>2.4</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.servicemix</groupId>
+      <artifactId>servicemix-core</artifactId>
+      <exclusions>
+        <exclusion>
+          <groupId>org.apache.geronimo.modules</groupId>
+          <artifactId>geronimo-transaction</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>org.apache.geronimo.modules</groupId>
+          <artifactId>geronimo-connector</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>org.apache.geronimo.specs</groupId>
+          <artifactId>geronimo-jms_1.1_spec</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>org.jencks</groupId>
+          <artifactId>jencks</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>org.apache.xbean</groupId>
+          <artifactId>xbean-naming</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>org.apache.activemq</groupId>
+          <artifactId>activemq-core</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>jaxen</groupId>
+          <artifactId>jaxen</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>hsqldb</groupId>
+          <artifactId>hsqldb</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>xalan</groupId>
+          <artifactId>xalan</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>xerces</groupId>
+          <artifactId>xercesImpl</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>mx4j</groupId>
+          <artifactId>mx4j</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>mx4j</groupId>
+          <artifactId>mx4j-remote</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>xml-apis</groupId>
+          <artifactId>xml-apis</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <configuration>
+          <source>1.5</source>
+          <target>1.5</target>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-war-plugin</artifactId>
+        <configuration>
+          <warSourceDirectory>src/main/webapp/</warSourceDirectory>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+
+</project>

Added: incubator/servicemix/trunk/apache-servicemix-web/src/main/java/org/apache/servicemix/web/http/HttpComponentListener.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/apache-servicemix-web/src/main/java/org/apache/servicemix/web/http/HttpComponentListener.java?view=auto&rev=469257
==============================================================================
--- incubator/servicemix/trunk/apache-servicemix-web/src/main/java/org/apache/servicemix/web/http/HttpComponentListener.java (added)
+++ incubator/servicemix/trunk/apache-servicemix-web/src/main/java/org/apache/servicemix/web/http/HttpComponentListener.java Mon Oct 30 12:18:25 2006
@@ -0,0 +1,104 @@
+/*
+ * 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.
+ */
+package org.apache.servicemix.web.http;
+
+import java.lang.reflect.Method;
+
+import javax.jbi.component.Component;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.servicemix.jbi.container.ContainerAware;
+import org.apache.servicemix.jbi.container.JBIContainer;
+import org.apache.servicemix.jbi.event.ComponentEvent;
+import org.apache.servicemix.jbi.event.ComponentListener;
+
+/**
+ * This ComponentListener is a hack to automatically configure
+ * the servicemix-http component in managed mode while avoiding
+ * to embed the component itself.
+ * 
+ * @author gnodet
+ */
+public class HttpComponentListener implements ComponentListener, ContainerAware {
+
+    private static final Log log = LogFactory.getLog(HttpComponentListener.class);
+    
+    private String name = "servicemix-http";
+    private JBIContainer container;
+    
+    /**
+     * @return the name
+     */
+    public String getName() {
+        return name;
+    }
+
+    /**
+     * @param name the name to set
+     */
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    /**
+     * @return the container
+     */
+    public JBIContainer getContainer() {
+        return container;
+    }
+
+    /**
+     * @param container the container to set
+     */
+    public void setContainer(JBIContainer container) {
+        this.container = container;
+    }
+
+    public void componentInstalled(ComponentEvent event) {
+    }
+
+    public void componentShutDown(ComponentEvent event) {
+    }
+
+    public void componentStarted(ComponentEvent event) {
+        if (getName().equals(event.getComponent().getName())) {
+            try {
+                Component component = event.getComponent().getComponent();
+                Method m = component.getClass().getMethod("getConfiguration", (Class[]) null);
+                Object cfg = m.invoke(component, (Object[]) null);
+                m = cfg.getClass().getMethod("isManaged", (Class[]) null);
+                Boolean b = (Boolean) m.invoke(cfg, (Object[]) null);
+                if (!b.booleanValue()) {
+                    m = cfg.getClass().getMethod("setManaged", new Class[] { boolean.class });
+                    m.invoke(cfg, new Object[] { Boolean.TRUE });
+                    event.getComponent().shutDown();
+                    event.getComponent().start();
+                }
+            } catch (Exception e) {
+                log.error("Unable to update component configuration", e);
+            }
+        }
+    }
+
+    public void componentStopped(ComponentEvent event) {
+    }
+
+    public void componentUninstalled(ComponentEvent event) {
+    }
+
+}

Added: incubator/servicemix/trunk/apache-servicemix-web/src/main/java/org/apache/servicemix/web/http/HttpManagedServlet.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/apache-servicemix-web/src/main/java/org/apache/servicemix/web/http/HttpManagedServlet.java?view=auto&rev=469257
==============================================================================
--- incubator/servicemix/trunk/apache-servicemix-web/src/main/java/org/apache/servicemix/web/http/HttpManagedServlet.java (added)
+++ incubator/servicemix/trunk/apache-servicemix-web/src/main/java/org/apache/servicemix/web/http/HttpManagedServlet.java Mon Oct 30 12:18:25 2006
@@ -0,0 +1,101 @@
+/*
+ * 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.
+ */
+package org.apache.servicemix.web.http;
+
+import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+import javax.jbi.component.Component;
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.servicemix.jbi.container.JBIContainer;
+import org.apache.servicemix.jbi.framework.ComponentMBeanImpl;
+import org.springframework.context.ApplicationContext;
+import org.springframework.web.context.support.WebApplicationContextUtils;
+
+/**
+ * This servlet is meant to be used when with the servicemix-http component.
+ * It is based on org.apache.servicemix.http.HttpManagedServlet, but
+ * uses introspection to be able to use it with an installed component,
+ * rather than an embedded component.
+ *  
+ * @author gnodet
+ */
+public class HttpManagedServlet extends HttpServlet {
+
+    public static final String CONTAINER_PROPERTY = "container";
+    public static final String CONTAINER_DEFAULT = "jbi";
+    
+    public static final String COMPONENT_PROPERTY = "component";
+    public static final String COMPONENT_DEFAULT = "servicemix-http";
+    
+    public static final String MAPPING_PROPERTY = "mapping";
+    
+    private JBIContainer container;
+    private Object processor;
+    private Method processorMethod;
+    
+    public void init(ServletConfig config) throws ServletException {
+        super.init(config);
+        
+        // Retrieve spring application context
+        ApplicationContext applicationContext = WebApplicationContextUtils.getRequiredWebApplicationContext(getServletContext());
+        
+        // Retrieve 
+        String containerName = config.getInitParameter(CONTAINER_PROPERTY);
+        if (containerName == null) {
+            containerName = CONTAINER_DEFAULT;
+        }
+        container = (JBIContainer) applicationContext.getBean(containerName);
+        if (container == null) {
+            throw new IllegalStateException("Unable to find jbi container " + containerName);
+        }
+    }
+    
+    protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+        try {
+            if (processor == null) {
+                String componentName = getServletConfig().getInitParameter(COMPONENT_PROPERTY);
+                if (componentName == null) {
+                    componentName = COMPONENT_DEFAULT;
+                }
+                ComponentMBeanImpl mbean = container.getComponent(componentName);
+                if (mbean == null) {
+                    throw new ServletException("Component " + componentName + " not installed");
+                }
+                Component component = mbean.getComponent();
+                Method mth = component.getClass().getMethod("getMainProcessor", (Class[]) null);
+                processor = mth.invoke(component, (Object[]) null);
+                processorMethod = processor.getClass().getMethod("process", new Class[] { HttpServletRequest.class, HttpServletResponse.class });
+            }
+            processorMethod.invoke(processor, new Object[] { request, response });
+        } catch (ServletException e) {
+            throw e;
+        } catch (RuntimeException e) {
+            throw e;
+        } catch (InvocationTargetException e) {
+            throw new ServletException("Failed to process request: " + e.getTargetException(), e.getTargetException());
+        } catch (Exception e) {
+            throw new ServletException("Failed to process request: " + e, e);
+        }
+    }
+}

Added: incubator/servicemix/trunk/apache-servicemix-web/src/main/webapp/WEB-INF/servicemix.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/apache-servicemix-web/src/main/webapp/WEB-INF/servicemix.xml?view=auto&rev=469257
==============================================================================
--- incubator/servicemix/trunk/apache-servicemix-web/src/main/webapp/WEB-INF/servicemix.xml (added)
+++ incubator/servicemix/trunk/apache-servicemix-web/src/main/webapp/WEB-INF/servicemix.xml Mon Oct 30 12:18:25 2006
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+    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.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:sm="http://servicemix.apache.org/config/1.0"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans 
+                           http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
+  
+  <bean id="placeholderConfig" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
+    <property name="location" value="classpath:servicemix-web-console.properties" />
+  </bean>
+  
+  <!-- JMX server -->
+  <sm:jmxServer id="server" locateExistingServerIfPossible="true" />
+  
+  <!-- the JBI container -->
+  <sm:container id="jbi" 
+                rootDir="./data/smx" 
+                MBeanServer="#server"
+                monitorInstallationDirectory="false"
+                monitorDeploymentDirectory="false"
+                createJmxConnector="false">
+    <sm:listeners>
+      <bean class="org.apache.servicemix.web.http.HttpComponentListener" />
+    </sm:listeners>
+                
+  </sm:container>
+  
+</beans>

Added: incubator/servicemix/trunk/apache-servicemix-web/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/apache-servicemix-web/src/main/webapp/WEB-INF/web.xml?view=auto&rev=469257
==============================================================================
--- incubator/servicemix/trunk/apache-servicemix-web/src/main/webapp/WEB-INF/web.xml (added)
+++ incubator/servicemix/trunk/apache-servicemix-web/src/main/webapp/WEB-INF/web.xml Mon Oct 30 12:18:25 2006
@@ -0,0 +1,126 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    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.
+-->
+
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
+                             http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+         version="2.4">
+
+    <description>
+      Apache ServiceMix Console
+    </description>
+    <display-name>Apache ServiceMix Console</display-name>
+
+    <context-param>
+        <param-name>contextConfigLocation</param-name>
+        <param-value>/WEB-INF/applicationContext.xml /WEB-INF/servicemix.xml</param-value>
+    </context-param>
+    <context-param>
+        <param-name>contextClass</param-name>
+        <param-value>org.apache.xbean.spring.context.XmlWebApplicationContext</param-value>
+    </context-param>
+
+    <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+    <!--              Configuration of the SiteMesh Filter.                                                                 -->
+    <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+    <filter>
+        <filter-name>sitemesh</filter-name>
+        <filter-class>com.opensymphony.module.sitemesh.filter.PageFilter</filter-class>
+    </filter>
+
+    <filter-mapping>
+        <filter-name>sitemesh</filter-name>
+        <url-pattern>/*</url-pattern>
+    </filter-mapping>
+    
+    <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+    <!--              Expose Spring POJOs to JSP                   .                                                             -->
+    <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+    <filter>
+        <filter-name>spring</filter-name>
+        <filter-class>org.apache.servicemix.web.filter.ApplicationContextFilter</filter-class>
+    </filter>
+
+    <filter-mapping>
+        <filter-name>spring</filter-name>
+        <url-pattern>/*</url-pattern>
+    </filter-mapping>
+
+    <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+    <!--              ServiceMix servlets                                                                                                -->
+    <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+        
+    
+    <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+    <!--              Spring listener.                   -->
+    <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+		<listener>
+		  <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
+		</listener>
+    <listener>
+      <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
+		</listener>
+
+    <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+    <!--         Configuration of the Spring MVC dispatcher              -->
+    <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+		<servlet>
+			<servlet-name>dispatcher</servlet-name>
+			<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
+			<load-on-startup>2</load-on-startup>
+		</servlet>
+		
+		<servlet>
+		  <servlet-name>servicemix-http</servlet-name>
+		  <servlet-class>org.apache.servicemix.web.http.HttpManagedServlet</servlet-class>
+		</servlet>
+
+    <servlet-mapping>
+        <servlet-name>dispatcher</servlet-name>
+        <url-pattern>*.action</url-pattern>
+    </servlet-mapping>
+    <servlet-mapping>
+        <servlet-name>dispatcher</servlet-name>
+        <url-pattern>*.svg</url-pattern>
+    </servlet-mapping>
+    <servlet-mapping>
+        <servlet-name>servicemix-http</servlet-name>
+        <url-pattern>/jbi/*</url-pattern>
+    </servlet-mapping>
+
+	  <welcome-file-list>
+			<welcome-file>index.html</welcome-file>
+			<welcome-file>index.jsp</welcome-file>
+		</welcome-file-list>
+		
+		<error-page>
+		  <exception-type>java.lang.Exception</exception-type>
+		  <location>/error.jsp</location>
+		</error-page>
+
+    <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+    <!--         Factor out common headers in JSP pages            -->
+    <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+	  <jsp-config>
+	    <jsp-property-group>
+	       <url-pattern>*.jsp</url-pattern>
+	       <include-prelude>/WEB-INF/jspf/headertags.jspf</include-prelude>
+	     </jsp-property-group>
+   </jsp-config>
+</web-app>