此内容没有您所选择的语言版本。

9.5. Configure a Global Valve


Global valves are enabled and configured in the web subsystem. This is done using the JBoss CLI tool.

Procedure 9.2. Configure a Global Valve

  1. Enable the Valve

    Use the add operation to add a new valve entry.
    /subsystem=web/valve=VALVENAME:add(module="MODULENAME",class-name="CLASSNAME")
    You need to specify the following values:
    • VALVENAME, the name that is used to refer to this valve in application configuration.
    • MODULENAME, the module that contains the value being configured.
    • CLASSNAME, the classname of the specific valve in the module.
    For example:
    /subsystem=web/valve=clientlimiter:add(module="clientlimitermodule",class-name="org.jboss.samplevalves.RestrictedUserAgentsValve")
  2. Optionally: Specify Parameters

    If the valve has configuration parameters, specify these with the add-param operation.
    /subsystem=web/valve=VALVENAME:add-param(param-name="PARAMNAME", param-value="PARAMVALUE")
    You need to specify the following values:
    • VALVENAME, the name that is used to refer to this valve in application configuration.
    • PARAMNAME, the name of the parameter that is being configured for specific valve.
    • PARAMVALUE, the value of the specified parameter.
    For example:

    Example 9.1. Valve configuration

    /subsystem=web/valve=clientlimiter:add-param(
       param-name="restrictedUserAgents", 
       param-value="^.*MS Web Services Client Protocol.*$"
    )
The valve is now enabled and configured for all deployed applications.
Refer to Create a Custom Valve section of the Developement Guide for more information on how to create a custom valve.
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.