3 Replies Latest reply on Sep 19, 2006 4:05 AM by alan Jones

    How do you set the transfer-encoding

    alan Jones Newbie

      Is it possible to set what transfer-encoding that JBoss uses for its web service responses. Currently, all our responses appear to use chunked encoding, but we'd prefer to use something else that doesn't add extra characters into the response sent down the wire.

      If it is possible, could you suggest how, or point me in the direction of somewhere that explains it.

      Thanks

        • 1. Re: How do you set the transfer-encoding
          Stefano Maestri Expert

          Tomcat in last versions use http-1.1 chunked encoding.
          As far as I know you can downgrade to http 1.0 in the client connection or better using 1.1 setting in the HTTP HEADER Connection=close.
          In java:

          HttpURLConnection conn = (HttpURLConnection) conn.openConnection();
          conn.setRequestProperty("Connection","close");
          


          • 2. Re: How do you set the transfer-encoding
            Eric Son Newbie

            Hi,

            I think I have a similar problem.

            I'm just starting to learn JBoss and J2EE.

            I just inherited a huge Web project running on JBoss. Part of this inheritance is the truckload of bugs, of course.

            My problem is:

            The server always serves up pages with the charset set to "Shift_JIS", even if the JSP pages explicitly states that the pages should have UTF-8 charset and encoding.

            Hence, once the pages are served, if you do a view-source, you'll see all the JSP code stating UTF-8 as the charset+encoding.

            However, if you submit a form, the parameters in the URI are all encoded in SJIS, thereby causing never-ending probelms on the server side.

            What do I need to do to make the pages served as UTF-8? Are there any configuration settings I need to override?

            • 3. Re: How do you set the transfer-encoding
              alan Jones Newbie

              OK, I found the solution (and cause) of the problem. Apparently .NET doesn't implement HTTP/1.1 correctly, so needs the following line adding to the connector element of the Tomcat server.xml file:
              restrictedUserAgents="^.*MS Web Services Client Protocol.*$"

              As with everything, once you know what to look for, you find it! There is an entry in the Wiki about it ;-)