2 Replies Latest reply on May 17, 2017 6:04 AM by wenfeng.he

    encoding problem

    wenfeng.he

      I use wildfly10.

       

      HttpClient client = HttpClientBuilder.create().build();

        HttpPost httppost = new HttpPost("http://127.0.0.1:28080/DPMS/accessTest"); 

       

        StringEntity postingString = new StringEntity("itemTitle=测试商品请不要拍",Charset.forName("utf-8"));

              try {

                   httppost.setEntity(postingString);

                   httppost.setHeader("Content-type", "application/x-www-form-urlencoded;charset=utf-8");

                   HttpResponse response = client.execute(httppost);

              }catch (Exception e) {

       

        }

      QQ截图20170517161504.jpg

       

      wildfly utf.jpg

       

      But in jboss-as-7.1.1.Final and tomcat8 ,it's ok.