The JAMon servlet filter

A Servlet filters is a simple piece of Java code that is executed whenever a Java Web Application resource is accessed. Resources include Servlets, JSP's, GIFs, JPeg's, and HTML documents. The simple filter example will monitor all of these. By using JAMon the filter becomes a powerful web site hit counter. Statistics for pages will be gathered such as hits, and execution time (avg, min, max). In addition you can see which pages are currently executing.

The JAMon servlet filter does not require ANY code changes. You simply put jamon's jar file in your servers classpath, put the following entry into your web.xml file, and install the JAMon war so you can view your statistics. Note you can choose what types of pages you would like to monitor by altering the 'url-pattern' element below. See Java documentation for more info on how servlet filters work.

Note: The order of entries of your web.xml files is important.

<web-app>
  <display-name>YourApp</display-name>
   <filter>
    <filter-name>JAMonFilter</filter-name>
    <filter-class>com.jamonapi.JAMonFilter</filter-class>
   </filter>

   <filter-mapping>
    <filter-name>JAMonFilter</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>

<!--
Servlet filter elements come before servlet elements
   <servlet>
    <servlet-name>demo</servlet-name>
    <jsp-file>/demo.jsp</jsp-file>
   </servlet>
-->

</web-app>

SourceForge.net Logo