2

For the reason that I want to use JavaEE7 and JPA2.1, I turned to WildFly9.0.1 Final which meets my requirement.

WildFly9.0.1 Final is using undertow as the Web Server.

Chinese Characters(in UTF-8 encoding) from web browser transferred to the jboss Server turned TO Garbled words,below is the log:

2015-08-02 18:58:38,893 INFO  com.gcable.action.people.people_type.PeopleTypeAction.printHttpRequest:76
 - peopleTypes[0].pt_name=[Ljava.lang.String;@3e31e9ad[{│フテ¥ᄒᄋ│ミᄄ}]

I am going mad! God save me!

I have tried this in standalone.xml:

<servlet-container name="default" default-encoding="UTF-8">

But it doesn't work.

Also I have tried to add jboss-web.xml in WEB-INF in my deployed war:

<jboss-web version="9.0" xmlns="http://www.jboss.com/xml/ns/javaee"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.jboss.org/j2ee/schema/jboss-web_9_0.xsd">
<default-encoding>UTF-8</default-encoding>

It doesn't work too.

M Zubair Shamshad
  • 2,741
  • 3
  • 23
  • 45
happyyangyuan
  • 179
  • 3
  • 14

2 Answers2

2

I solved the problem by setting the encoding in the http-listener of the standalone.xml (i use the standalone-full.xml but i guess it makes no difference)

<http-listener name="default" socket-binding="http" url-charset="ISO-8859-1"/>

Sorry for the late answer but i got the same problem today. Hope it will be helpful.

  • Kind of bizarre, for some reason sometimes wildfly deletes that url-charset from standalone.xml for me, I revoked the right of write now it fully functional. However this resolved our problem after 30 hours of research. I would upvote it twice if I could. – CsBalazsHungary Aug 05 '16 at 12:00
  • I noticed the same behavior when editing the standalone-full.xml while wildfly is running, so i always stop the server before any editing of the standalone-full.xml and then restart it. – Paolo Franzini Aug 10 '16 at 09:37
0

I finally tried to down-grade my JPA2.1 to 2.0. Jboss EAP 6.2 perfectly encodes the none-english characters.

By the way, I found sth here to make JBOSS EAP6 which in fact is a JavaEE6 Container to USE JPA2.1 instead of using 2.0

Community
  • 1
  • 1
happyyangyuan
  • 179
  • 3
  • 14