我在尝试设置 file.encoding
为jboss。我正在尝试设置 file.encoding
到 UTF-8
借助
JAVA_OPTS : -Dfile.encoding=UTF-8
每当我以交互式的方式运行jboss时,我都能在下面找到 server.log
:
file.encoding = UTF-8
每当jboss以windows服务的形式运行时,我都能在以下地方找到 server.log
:
file.encoding = Cp1252
在 standalone.xml
我也定义了下面的系统属性(但不成功)。
<property name="file.encoding" value="UTF-8"/>
<property name="org.apache.catalina.connector.URI_ENCODING" value="UTF-8"/>
有谁知道我们需要在哪里做配置,才能有 file.encoding = UTF-8
当jboss作为一个windows服务运行时,我遇到了一些问题。
如果你使用脚本 bin/service.bat
将JBoss 7.2安装为Windows服务,然后通过以下方式启动服务器。standalone.bat
. 这意味着启动选项可以在 bin/standalone.conf.bat
.
有一个JAVA_OPTS任务块,在 bin/standalone.conf.bat
我在其中添加了以下两行
rem # Use UTF-8 as default encoding:
set "JAVA_OPTS=%JAVA_OPTS% -Dfile.encoding=UTF-8"
重启服务后,JBoss实例使用UTF-8作为默认编码。