JBOSS 7 编码未按预期工作 [英] JBOSS 7 encoding not working as expected

查看:21
本文介绍了JBOSS 7 编码未按预期工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的列表网格无法正确显示变音符号时遇到问题,我发现当我从 java 插入数据库时​​,值已经被窃听了.

I had problems with my listgrids not showing diacritcs corectly and I found out that when I inserted from java into the db the values where already bugged.

此处的帖子有所帮助,我更改了项目属性 -> 文本编码 -> 其他 -> UTF-8,这解决了我的问题.问题是这只能在本地解决我的问题.

A post here helped and I changed my project properties -> Text encoding -> other -> UTF-8 and this fixed my problem. Thing is this only fixes my problem locally.

我需要做的是在我的 Jboss 服务器上也以某种方式设置编码.这是我放在我的配置文件中的内容:

What I need to do is on my Jboss server also set the encoding somehow. This is what I put in my configuration file:

    <?xml version='1.0' encoding='UTF-8'?>

<server name="vali-ubuntu" xmlns="urn:jboss:domain:1.0">
    extensions>
        extension module="org.jboss.as.clustering.infinispan"/>
        extension module="org.jboss.as.connector"/>
        extension module="org.jboss.as.deployment-scanner"/>
        extension module="org.jboss.as.ee"/>
        extension module="org.jboss.as.ejb3"/>
        extension module="org.jboss.as.jaxrs"/>
        extension module="org.jboss.as.jmx"/>
        extension module="org.jboss.as.logging"/>
        extension module="org.jboss.as.naming"/>
        extension module="org.jboss.as.osgi"/>
        extension module="org.jboss.as.remoting"/>
        extension module="org.jboss.as.sar"/>
        extension module="org.jboss.as.security"/>
        extension module="org.jboss.as.threads"/>
        extension module="org.jboss.as.transactions"/>
        extension module="org.jboss.as.web"/>
        extension module="org.jboss.as.weld"/>
    /extensions>
     system-properties>
        property name="org.apache.catalina.connector.URI_ENCODING" value="UTF-8"/>
        property name="org.apache.catalina.connector.USE_BODY_ENCODING_FOR_QUERY_STRING" value="tru
e"/>
    /system-properties>

//.....

这不起作用,所以也许我需要添加其他内容.我尝试了所有我能找到的方法,但没有成功,因此感谢您提供任何帮助.谢谢.

This doesn't work so maybe I need to add something else. I tried everything I could find with no succes so any help is appreciated. Thanks.

据我所知,这仅适用于 jboss 7.1.0 beta 1 或更高版本.(URIEncoding) 并且我使用 JBoss 7.0.2 所以我需要替换 7.0.2

From what I read, this will work only in jboss 7.1.0 beta 1 or highier. (URIEncoding) and I use JBoss 7.0.2 so I need a replacement for 7.0.2

推荐答案

对于 jboss-as-7.1.1.Final 我在standalone.conf 中添加了这一行,这个文件位于 standalone.conf 目录下强>斌:

for jboss-as-7.1.1.Final i added this line to standalone.conf, this file lives under the directory bin:

JAVA_OPTS="$JAVA_OPTS -Dorg.apache.catalina.connector.URI_ENCODING=UTF-8"

这篇关于JBOSS 7 编码未按预期工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆