com.jamonapi
Class JAMonFilter
java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
com.jamonapi.JAMonFilter
- All Implemented Interfaces:
- java.io.Serializable, javax.servlet.Filter, javax.servlet.Servlet, javax.servlet.ServletConfig
public class JAMonFilter
- extends javax.servlet.http.HttpServlet
- implements javax.servlet.Filter
The following should be put in the Web Application's web.xml file to enable servlet monitoring.
This servlet filter will enable any file access to html, jpg, jsp, servlet or any other file
resource that is part of the web application. You can change the filter-mapping element below
in the web.xml file in include/not include different files from monitoring. Use JAMonAdmin.jsp
to display any collected data.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<display-name>fdsapi</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>
<servlet-name>demo</servlet-name>
<jsp-file>/demo.jsp</jsp-file>
</servlet>
-->
</web-app>
- See Also:
- Serialized Form
Method Summary |
void |
destroy()
|
void |
doFilter(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
javax.servlet.FilterChain filterChain)
Called as part of the standard servlet contract before a page is requested. |
protected java.lang.String |
getURI(javax.servlet.ServletRequest request)
|
void |
init(javax.servlet.FilterConfig filterConfig)
|
Methods inherited from class javax.servlet.http.HttpServlet |
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service |
Methods inherited from class javax.servlet.GenericServlet |
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JAMonFilter
public JAMonFilter()
doFilter
public void doFilter(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
javax.servlet.FilterChain filterChain)
throws java.io.IOException,
javax.servlet.ServletException
- Called as part of the standard servlet contract before a page is requested. It is a hook point for JAMon to track metrics
- Specified by:
doFilter
in interface javax.servlet.Filter
- Throws:
java.io.IOException
javax.servlet.ServletException
getURI
protected java.lang.String getURI(javax.servlet.ServletRequest request)
init
public void init(javax.servlet.FilterConfig filterConfig)
throws javax.servlet.ServletException
- Specified by:
init
in interface javax.servlet.Filter
- Throws:
javax.servlet.ServletException
destroy
public void destroy()
- Specified by:
destroy
in interface javax.servlet.Filter
- Specified by:
destroy
in interface javax.servlet.Servlet
- Overrides:
destroy
in class javax.servlet.GenericServlet