I want to bind a JPA EntityManager to the current thread on each request (via ThreadLocal), what could be done via a ServletRequestListener or Filter. The listener looks cleaner and I don't need the additional possibilities of a filter in this case. But maybe the filter has an advantage I've missed.
Should I use a Servlet Filter or a ServletRequestListener to do that?