How to add Valve to Apache Tomcat
-
12-06-2021 - |
Pergunta
I wrote a Valve for Apache Tomcat by extending org.apache.catalina.valves.ValveBase class and implementing inovoke() method. Now I want to add it to my Tomcat for execution? Please show me the steps.
Solução
Create a jar with your Valve class.
Drop this into the $TOMCAT_HOME/lib folder.
Modify the server.xml to add the valve under Engine or Host tag as shown below, depending on which level you want it to operate.
<Engine name="Catalina" defaultHost="localhost">
<Valve className="org.whatever.MyCustomValve" />
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow