https://issues.apache.org/bugzilla/show_bug.cgi?id=55399

--- Comment #2 from Guillermo Grandes <guillermo.gran...@gmail.com> ---
Tested on tomcat-7.0.42

ServletWriter.println() don't work as expect (response.sendError clear the
response buffer), but changing ServletWriter to System.out output is:

protected void doPost(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
    // ...
    System.out.println("request locale=" + request.getLocale());
    System.out.println("server locale=" + Locale.getDefault());
    response.sendError(HttpServletResponse.SC_BAD_REQUEST, "BAD REQUEST");
}

--- Eclipse console ---
request locale=en
server locale=es_ES
---

# Request:
curl -i -H "Accept-Language: en" -d "" "http://x.x.x.x:8080/LocaleTest";
---
HTTP/1.1 400 Petición incorrecta
Server: Apache-Coyote/1.1
Content-Type: text/html;charset=ISO-8859-1
Content-Length: 1010
Date: Sun, 11 Aug 2013 21:29:02 GMT
Connection: close

<html><head><title>Apache Tomcat/7.0.42 - Informe de Error</title><style><!--H1
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;}
H2
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;}
H3
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;}
BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;}
B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P
{font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A
{color : black;}A.name {color : black;}HR {color : #525D76;}--></style>
</head><body><h1>Estado HTTP 400 - BAD REQUEST</h1><HR size="1"
noshade="noshade"><p><b>type</b> Informe de estado</p><p><b>mensaje</b> <u>BAD
REQUEST</u></p><p><b>descripción</b> <u>El requerimiento enviado por el cliente
era sintácticamente incorrecto.</u></p><HR size="1"
noshade="noshade"><h3>Apache Tomcat/7.0.42</h3></body></html>
---

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to