TracEE binding for Java Servlets

tracee-servlet contains Servlet-Listeners and -Filters that allows you to use TracEE Context Propagation with Java Servlets.

  • TraceeServletRequestListener: Parses a TracEE-Context from a ServletHttpRequest-Header before a request is processed by a servlet. It also cleans the TraceeBackend when the request processing is finished by the container.
  • TraceeFilter: Writes a TracEE-Context back to a ServletHttpResponse-Header.
  • TraceeSessionListener: Listens on Session.create() and Session.destroy() events and creates and deletes the tracee-sessionId from the TracEE-Backend accordingly.


Its super-easy for Servlet3+-Containers. Just add tracee-servlet-VERSION.jar to your webapp-classpath (WEB-INF/lib or as maven runtime dependency). tracee-servlet contains a web-fragment.xml that registers all required filters and event listeners.

If you’re use Maven for your dependency management simple add this to your pom:

<!-- … -->
<!-- … -->

If you are on a Servlet-Container with servlet-version < 3, you need to register the following filters in your web.xml:

<!-- … -->
<!-- … -->

You may change the filter-mapping:url-pattern according to your needs.

Spring Boot

If you’re running in an embedded SpringBoot container you’ve to add the ServletListener and Filter to your application configuration:

public FilterRegistrationBean traceeFilter() {
    FilterRegistrationBean frb = new FilterRegistrationBean();
    frb.setFilter(new TraceeFilter());
    return frb;

public ServletListenerRegistrationBean traceeServletListener() {
    return new ServletListenerRegistrationBean<TraceeServletRequestListener>(new TraceeServletRequestListener());


This project is released under the revised BSD License.

Social Links


Web-Template based on SOLID by Carlos Alvarez and remixed according to the Creative Commons Attribution 3.0 License.