Este conteúdo não está disponível no idioma selecionado.
4.4. Configure a Web Application to use a Valve
jboss-web.xml
deployment descriptor.
Important
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.xml
deployment descriptor.
Procedure 4.1. Configure an application for a local valve
Configure a Valve
Create avalve
element containing theclass-name
child element in the application'sjboss-web.xml
file. Theclass-name
is the name of the valve class.<valve> <class-name>VALVE_CLASS_NAME</class-name> </valve>
Example 4.1. Valve element configured in the jboss-web.xml file
<valve> <class-name>org.jboss.security.negotiation.NegotiationAuthenticator</class-name> </valve>
Configure a Custom Valve
If the valve has configurable parameters, add aparam
child element to thevalve
element for each parameter, specifying theparam-name
andparam-value
for each.Example 4.2. Custom valve element configured in the jboss-web.xml file
<valve> <class-name>org.jboss.web.tomcat.security.GenericHeaderAuthenticator</class-name> <param> <param-name>httpHeaderForSSOAuth</param-name> <param-value>sm_ssoid,ct-remote-user,HTTP_OBLIX_UID</param-value> </param> <param> <param-name>sessionCookieForSSOAuth</param-name> <param-value>SMSESSION,CTSESSION,ObSSOCookie</param-value> </param> </valve>
Example 4.3. jboss-web.xml valve configuration
<valve> <class-name>org.jboss.samplevalves.RestrictedUserAgentsValve</class-name> <param> <param-name>restrictedUserAgents</param-name> <param-value>^.*MS Web Services Client Protocol.*$</param-value> </param> </valve>