如何使用jboss.cli添加underwow的自定义过滤器

问题描述 投票:0回答:1

服务器: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个回答
0
投票

您可以使用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,以便自动完成。

© www.soinside.com 2019 - 2024. All rights reserved.