Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.

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 configured in the jboss-web.xml deployment descriptor.

Important

Valves that are installed as global valves are automatically applied to all deployed applications. For instructions on how to configure Global Valves, see Global Valves in the JBoss EAP Administration and Configuration Guide.

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

  1. Configure a Valve

    Create a valve element containing the class-name child element in the application's jboss-web.xml file. The class-name is the name of the valve class.
    <valve>
      <class-name>VALVE_CLASS_NAME</class-name>
    </valve>
    Copy to Clipboard Toggle word wrap

    Example 4.1. Valve element configured in the jboss-web.xml file

    <valve>
      <class-name>org.jboss.security.negotiation.NegotiationAuthenticator</class-name>
    </valve>
    Copy to Clipboard Toggle word wrap
  2. Configure a Custom Valve

    If the valve has configurable parameters, add a param child element to the valve element for each parameter, specifying the param-name and param-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>
    Copy to Clipboard Toggle word wrap
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

<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>
Copy to Clipboard Toggle word wrap
Red Hat logoGithubredditYoutubeTwitter

Lernen

Testen, kaufen und verkaufen

Communitys

Über Red Hat Dokumentation

Wir helfen Red Hat Benutzern, mit unseren Produkten und Diensten innovativ zu sein und ihre Ziele zu erreichen – mit Inhalten, denen sie vertrauen können. Entdecken Sie unsere neuesten Updates.

Mehr Inklusion in Open Source

Red Hat hat sich verpflichtet, problematische Sprache in unserem Code, unserer Dokumentation und unseren Web-Eigenschaften zu ersetzen. Weitere Einzelheiten finden Sie in Red Hat Blog.

Über Red Hat

Wir liefern gehärtete Lösungen, die es Unternehmen leichter machen, plattform- und umgebungsübergreifend zu arbeiten, vom zentralen Rechenzentrum bis zum Netzwerkrand.

Theme

© 2026 Red Hat
Nach oben