【问题标题】:How to add custom filter of undertow by using jboss.cli如何使用 jboss.cli 添加自定义过滤器
【发布时间】:2020-02-14 13:11:16
【问题描述】:

服务器:WindFly 15,Undertow 8

我按照文章http://www.mastertheboss.com/jboss-web/jbosswebserver/configuring-undertow-filters-on-wildfly 创建了一个自定义过滤器“MyFilter”。但是我没有找到使用 jboss.cli 将其添加到配置中的方法。

我试过 /subsystem=undertow/configuration=filter/filter=myFilter/:add(module=com.xxx.myfilter,class-name=com.xxx.MyFilter),得到以下错误:

ERROR [org.jboss.as.cli.CommandContext] Failed to get the list of the operationproperties: "WFLYCTL0030: No resource definition is registered for address [
    ("subsystem" => "undertow"),
    ("configuration" => "filter"),
    ("filter" => "myFilter")

那么我们是否只能通过手动编辑配置文件来添加过滤器?

【问题讨论】:

    标签: jboss servlet-filters undertow


    【解决方案1】:

    您可以通过以下命令使用 cli 添加:

    /subsystem=undertow/configuration=filter/custom-filter
    

    原答案可以在here找到。


    这与Guide Configuring The Web Server ~ Undertow - Chapter 17.6 上解释的自定义过滤器创建有关

    /subsystem=undertow/configuration=filter/response-header=new-response-header:add(header-name=new-response-header,header-value="My Value")
    

    提示

    主要提示是使用Tab,以便自动完成。

    【讨论】:

      猜你喜欢
      • 2016-06-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-02-05
      • 2021-09-21
      • 2017-09-10
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多