Web Configuration- 1- Add zentracker.jar to the classpath
- 2- Modify the Spring configuration file of the application
<bean class="com.zenika.zentracker.spring.WebZenTrackerConfigurer"/> - 3- Modify log4j.properties
# Loggers used by the ZenTracker tool
log4j.logger.com.zenika.ZenTracker=debug In case you want to activate the statistics export via JMX (it is off by default) - 1- The following configuration is needed on the web.xml file, adding a listener (Servlet 2.4+). This listener is not needed if already using a Spring ServletDispatcher. Please check the JavaDoc of the RequestContextListener class.
<listener>
<listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
</listener> - 2- By default the SessionID is used to identify a Session. If you want to display a value stored in the session instead of the SessionID than it is possible to use one of the HttpSession attributes. To toString() method on the value object will be used.
<bean class="com.zenika.zentracker.spring.WebZenTrackerConfigurer">
<property name="sessionAttributeIdentifier" value="{please use a session attribute}"/>
<property name="exportJMXStatistics" value="true"/>
</bean>JAVADOC: / - Servlet 2.4+ listener that exposes the request to the current thread,
- through both {@link org.springframework.context.i18n.LocaleContextHolder} and
- {@link RequestContextHolder}. To be registered as listener in
web.xml . -
Alternatively, Spring's {@link org.springframework.web.filter.RequestContextFilter} - and Spring's {@link org.springframework.web.servlet.DispatcherServlet} also expose
- the same request context to the current thread. In contrast to this listener,
- advanced options are available there (e.g. "threadContextInheritable").
-
This listener is mainly for use with third-party servlets, e.g. the JSF FacesServlet. - Within Spring's own web support, DispatcherServlet's processing is perfectly sufficient.
-
- @author Juergen Hoeller
- @since 2.0
- @see javax.servlet.ServletRequestListener
- @see org.springframework.context.i18n.LocaleContextHolder
- @see org.springframework.web.context.request.RequestContextHolder
- @see org.springframework.web.filter.RequestContextFilter
- @see org.springframework.web.servlet.DispatcherServlet
-
|