Tag Archives: tomcat

TomEE: LazyValve or how to provide a Valve in a war


Tomcat Valve mecanism is a way to have a kind of servlet filter but before the servlet chain. In two words it is commonly used for container and security usages/needs.

Main issue is the common way to add a valve is to configure it in server.xml or context.xml. Even if this last one can be packaged in a war, the valve itself can’t since this file is used before the webapp classloader is setup to build the webapp setup/context.

To solve it TomEE now provides a LazyValve implementation.

Continue reading