You can configure custom valves and Catalina listeners for web modules or virtual servers by defining properties. In the domain.xml file, valve and listener properties look like this:
<web-module ...> <property name="valve_1" value="org.glassfish.extension.Valve"/> <property name="listener_1" value="org.glassfish.extension.MyLifecycleListener"/> </web-module>
You can define these properties in one of the following ways, then restart the server:
You can define properties using the asadmin set command. For example:
asadmin set domain1.applications.web-module.MyWebMod.property.valve_1="org.glassfish.extension.Valve" |
asadmin set config1.http-service.virtual-server.MyVS.property.valve_1="org.glassfish.extension.Valve" |
You can define virtual server properties using the Admin Console. Select the HTTP Service component under the relevant configuration, select Virtual Servers, and select the desired virtual server. Select Add Property, enter the property name and value, check the enable box, and select Save. For details, click the Help button in the Admin Console.