Websphere 8.5 Liberty Profile - setLocale Servlet API
I am using Liberty Websphere 8.5 profile with Fixpack 1 and ran into the following issue which seems to break the Servlet API.
The content language response header is not set after response.setLocale () if the response body is written to the response output stream (HttpServletResponse # getOutputStream ()). It works fine if the body is written instead of the author of the response (HttpServletResponse # getWriter ())
The following JSP does not return Content-Language response header:
<%@ page contentType="text/plain;charset=ISO-8859-1" session="false" import="java.util.*" %><%
response.setLocale(Locale.ITALY);
java.io.OutputStream os = response.getOutputStream();
try {
os.write("Hello World".getBytes("ISO-8859-1"));
} finally {
os.close();
}
%>
Note that the JSP must not contain any characters outside of <% ...%>, not even a terminating newline at the end of the file. I am using JSP here to reproduce the case - of course the writer would be the usual way. We are using #getOutputStream inside our Java code.
Is my assumption correct that this behavior violates the Servlet specification? If so, what is the best way to report these bugs to IBM?
I came across a slightly related bug report with a Content-Language response header that was only submitted against the Liberty profile (and was fixed in FP1): http://www-01.ibm.com/support/docview.wss?rs=180&uid = swg1PM67523
source to share