Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
<?xml version="1.0"?>
<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_4.dtd">

<web-app>
  <display-name>shindig-spring-example web descriptor</display-name>

  <!-- configuration -->
  <!-- If you have your own Guice module(s), put them here as a colon-separated list. -->
  <context-param>
    <param-name>guice-modules</param-name>
    <param-value>
      org.apache.shindig.common.PropertiesModule:
      org.apache.shindig.samples.springexample.config.GuiceModule
    </param-value>
  </context-param>

  <!-- Shindig authentication filter -->
  <filter>
    <filter-name>authFilter</filter-name>
    <filter-class>org.apache.shindig.auth.AuthenticationServletFilter</filter-class>
  </filter>

  <filter-mapping>
    <filter-name>authFilter</filter-name>
    <url-pattern>/social/*</url-pattern>
  </filter-mapping>

  <!-- GuiceServletContextListener -->
  <listener>
    <listener-class>org.apache.shindig.common.servlet.GuiceServletContextListener</listener-class>
  </listener>

  <!-- ApplicationServletContextListener -->
  <!-- Destroys Spring's ApplicationContext at shutdown, forcing bean defined destroy-methods to be invoked -->
  <listener>
    <listener-class>org.apache.shindig.samples.springexample.servlet.ApplicationServletContextListener</listener-class>
  </listener>

  <!-- Serve REST api -->
  <servlet>
    <servlet-name>restapiServlet</servlet-name>
    <servlet-class>
      org.apache.shindig.protocol.DataServiceServlet
    </servlet-class>
  </servlet>

  <!-- Serve RPC api -->
  <servlet>
    <servlet-name>jsonRpcServlet</servlet-name>
    <servlet-class>
      org.apache.shindig.protocol.JsonRpcServlet
    </servlet-class>
  </servlet>

  <servlet-mapping>
    <servlet-name>restapiServlet</servlet-name>
    <url-pattern>/social/rest/*</url-pattern>
  </servlet-mapping>

  <servlet-mapping>
    <servlet-name>jsonRpcServlet</servlet-name>
    <url-pattern>/social/rpc/*</url-pattern>
  </servlet-mapping>
</web-app>

Example Source Code