このコンテンツは選択した言語では利用できません。
4.4. Configure a Web Application to use a Valve
Valves that are not installed as global valves must be included with your application and configure in the
jboss-web.xml deployment descriptor.
Important
Valves that are installed a global valves are automatically applied to all deployed applications. For instructions on how to configure Global Valves, see the chapter entitled Global Valves in the Administration and Configuration Guide for JBoss EAP.
Prerequisites
- The valve must be created and included in your application's classpath. This can be done by either including it in the application's WAR file or any module that is added as a dependency. Examples of such modules include a static module installed on the server or a JAR file in the
lib/directory of an EAR archive if the WAR is deployed in an EAR. - The application must include a
jboss-web.xmldeployment descriptor.
Procedure 4.1. Configure an application for a local valve
Configure a Valve
Create avalveelement containing theclass-namechild element in the application'sjboss-web.xmlfile. Theclass-nameis the name of the valve class.<valve> <class-name>VALVE_CLASS_NAME</class-name> </valve><valve> <class-name>VALVE_CLASS_NAME</class-name> </valve>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example 4.1. Example of a valve element configured in the jboss-web.xml file
<valve> <class-name>org.jboss.security.negotiation.NegotiationAuthenticator</class-name> </valve><valve> <class-name>org.jboss.security.negotiation.NegotiationAuthenticator</class-name> </valve>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Configure a Custom Valve
If the valve has configurable parameters, add aparamchild element to thevalveelement for each parameter, specifying theparam-nameandparam-valuefor each.Example 4.2. Example of a custom valve element configured in the jboss-web.xml file
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
When the application is deployed, the valve will be enabled for the application with the specified configuration.
Example 4.3. jboss-web.xml valve configuration