utf 8 - How to set default-encoding in undertow subsystem as utf-8 with a CLI script? -
i'm running wildfly10 application server. noticed changed default encoding in standalone.xml configuration file utf-8, change got erased server rebooted.
then read should use cli script. now, how can that? form of cli script add attribute default-encoding="utf-8" undertow subsystem follows:
here's unmodified part of standalone.xml:
<subsystem xmlns="urn:jboss:domain:undertow:3.0"> <buffer-cache name="default"/> <server name="default-server"> <http-listener name="default" socket-binding="http" redirect-socket="http"/> <host name="default-host" alias="localhost"> <location name="/" handler="welcome-content"/> <filter-ref name="server-header"/> <filter-ref name="x-powered-by-header"/> </host> </server> <servlet-container name="default"> <jsp-config/> <websockets/> </servlet-container> <handlers> <file name="welcome-content" path="${jboss.home.dir}/welcome-content"/> </handlers> <filters> <response-header name="server-header" header-name="server" header-value="wildfly/10"/> <response-header name="x-powered-by-header" header-name="x-powered-by" header-value="undertow/1"/> </filters> </subsystem>
and here modified, i'd and remain in standalone.xml:
<subsystem xmlns="urn:jboss:domain:undertow:3.0"> <buffer-cache name="default"/> <server name="default-server"> <http-listener name="default" socket-binding="http" redirect-socket="https"/> <host name="default-host" alias="localhost"> <location name="/" handler="welcome-content"/> <filter-ref name="server-header"/> <filter-ref name="x-powered-by-header"/> </host> </server> <servlet-container name="default" default-encoding="utf-8"> <jsp-config/> <websockets/> </servlet-container> <handlers> <file name="welcome-content" path="${jboss.home.dir}/welcome-content"/> </handlers> <filters> <response-header name="server-header" header-name="server" header-value="wildfly/10"/> <response-header name="x-powered-by-header" header-name="x-powered-by" header-value="undertow/1"/> </filters> </subsystem>
so only thing changed here added default-encoding="utf-8"
attribute in <servlet-container>
tag. how can add via cli script? thank you.
run write-attribute operation on servlet-container resource
/subsystem=undertow/servlet-container=default:write-attribute(name="default-encoding" value="utf-8")
Comments
Post a Comment