Details
-
Bug
-
Resolution: Done
-
Major
-
8.1.0.Final
-
None
Description
I have a very simple Servlet
@WebServlet("/HelloServlet")
public class HelloServlet extends HttpServlet
with a doGet method that prints and returns the "foo" parameter:
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{ response.setContentType("text/html;charset=UTF-8"); PrintWriter out = response.getWriter(); String foo = request.getParameter("foo"); out.println("Hello " + foo); System.out.println("Hello " + foo); out.close(); }When running jboss 7.1.1.Final this works fine. I can test with a simple curl script:
curl http://127.0.0.1:8080/hello-1/HelloServlet?foo=b$'\xc3\xa5'r
where $'\xc3\xa5' is "aring" or "a with a ring", (å). I know the console can handle this, because echo $'\xc3\xa5' gives:
[slydell@localhost hello]$ echo $'\xc3\xa5'
å
[slydell@localhost hello]$
If I run the curl script on jboss 7.1.1.Final I get:
[slydell@localhost hello]$ curl http://127.0.0.1:8080/hello-1/HelloServlet?foo=b$'\xc3\xa5'r
Hello bår
[slydell@localhost hello]$
and the jboss console output says:
09:18:19,483 INFO [stdout] (http--127.0.0.1-8080-1) Hello bår
I can change this output by adding
JAVA_OPTS="$JAVA_OPTS -Dorg.apache.catalina.connector.URI_ENCODING=UTF-8"
to the standalone.conf. With that flag I get:
09:20:57,780 INFO [stdout] (http--127.0.0.1-8080-1) Hello bår
But when I run the curl script on wildfly 8.1.0.Final I get different results. I know that the catalina flag has no effect on undertow, and I have also tried all the workarounds I've seen, e.g.
- implement a CharacterEncoding filter
- set encoding in jboss-web.xml
- set default-encoding in servlet-containter in the standalone.xml
- set encoding in the http-listener in the standalone.xml
None of these workarounds have any effect. I always get the same result:
09:22:42,330 INFO [stdout] (default task-1) Hello bᅢᆬr
which does not look like anything I've seen in UTF-8 or ISO-8859-1.
If I could get the same output as I do in the jboss 7.1.1.Final (without the catalina flag) I would be very happy. The standard non-modified jboss 7.1.1 gave me this output:
09:31:11,723 INFO [stdout] (http--127.0.0.1-8080-1) Hello bår
So my question is, how do I modify/configure wildfly so that I get the same output as I do in the standard jboss 7.1.1.Final? I have tried the known workarounds, and they did not change any output.
Attachments
Issue Links
- is blocked by
-
UNDERTOW-257 Support non-encoded, non-ascii characters in the URL
- Resolved