Install Appspy in your application

Install your Appspy server

If not yet done, don't forget to install your Appspy server.

Install your Appspy home directory

At first you have to install the Appspy home directory :

  1. Download org.appspy.distrib.client-1.1-dir.zip
  2. Unzip it in the home directory of your application server. Now you should have a directory called "appspy" in your home directory.
    [me@mycomputer]$ tree -L 2 appspy
    appspy
    `-- client
        |-- common
        |-- conf
        |-- core
        `-- servlet
  3. Edit the file "appspy/client/conf/appspy-config-default.properties"
    [me@mycomputer]$ vi appspy/client/conf/appspy-config-default.properties
  4. Set the correct value of the property "defaultCollectionService.serviceUrl"
    defaultCollectionService.serviceUrl=http://<appspy-server-host>:<appspy-server-port>/org.appspy.server.webapp/service/DataCollectionService

Install Appspy in your web application

Add the Appspy client-side jars in WEB-INF/lib

Add Appspy definitions in your application

  • Add those definitions in your web.xml (respect the order of the dtd) :
    <context-param>
            <description>Appspy application name</description>
            <param-name>org.appspy.applicationName</param-name>
            <param-value><Name of your application></param-value>
    </context-param>
    
    <context-param>
            <description>Appspy application version</description>
            <param-name>org.appspy.version</param-name>
            <param-value><Version of your application></param-value>
    </context-param>
    
    <filter>
            <filter-name>AppSpyFilter</filter-name>
            <filter-class>org.appspy.perf.servlet.AppSpyFilter</filter-class>
    </filter>
    
    <!-- Map the Appspy filter with the URLs -->
    <filter-mapping>
            <filter-name>AppSpyFilter</filter-name>
            <url-pattern>/*</url-pattern>
            <dispatcher>REQUEST</dispatcher>
            <dispatcher>FORWARD</dispatcher>
            <dispatcher>INCLUDE</dispatcher>
            <dispatcher>ERROR</dispatcher>
    </filter-mapping>
    
    <servlet>
            <servlet-name>AppspyStatusServlet</servlet-name>
            <servlet-class>org.appspy.perf.servlet.AppspyStatusServlet</servlet-class>
    </servlet>
    
    <servlet>
            <servlet-name>AppspyControlServlet</servlet-name>
            <servlet-class>org.appspy.perf.servlet.AppspyControlServlet</servlet-class>
    </servlet>
    
    <servlet-mapping>
            <servlet-name>AppspyStatusServlet</servlet-name>
            <url-pattern>/appspy-status</url-pattern>
    </servlet-mapping>
    
    <servlet-mapping>
            <servlet-name>AppspyControlServlet</servlet-name>
            <url-pattern>/appspy-control</url-pattern>
    </servlet-mapping>

Try it

  • Deploy your application
  • Play with it
  • Go to the Appspy viewer application to analyse the datas :
    • http://appspy-server-host:appspy-server-port/org.appspy.viewer.webapp