You configured encoding properly. As far as WildFly configuration goes.
but, your debugging process is flawed.
you are testing servlet encoding outputs but you are outputting to system out, where encoding has noting to do with servlet or WildFly at all.
you should make sure that your console support UTF encoding and make sure your compiler is configured to compile using UTF8.
what you are testing could be tested by simple public static void main app no need for servlets.
To test servlets encoding try writing to servlet's response writer / outputstream and see it in browser.
Hi Tomaz Cerar
Thanks replying to me,the same as you say,because my console's encode isn't utf-8,so it can't show chinese.I modify it to utf-8 and it show formally.
Now,I want to make sure one thing.If my project's encode is GBK，I can modify the WildFly’s encoding by this way as following?
Setting default-encoding to "GBK"
Is it the correct way to modify WildFly uri encoding?Does it work?
I know on the JBoss As 7，we can configure it by modify standalone.xml as following:
<property name="org.apache.catalina.connector.URI_ENCODING" value="UTF-8"/>
<property name="org.apache.catalina.connector.USE_BODY_ENCODING_FOR_QUERY_STRING" value="true"/>
But I don't how to set it on WildFly,please tell me a exactly answer,thanks!
1 of 1 people found this helpful
I know what you say,and i test successfully.