Character encoding in Content-Type is ignored
---------------------------------------------

                 Key: MYFACES-2008
                 URL: https://issues.apache.org/jira/browse/MYFACES-2008
             Project: MyFaces Core
          Issue Type: Bug
          Components: General
    Affects Versions: 1.1.6
            Reporter: Taro App


In a constructor of ServletExternalContextImpl.java, if character encoding is 
looked up from Content-Type header, it is not set on request character encoding.

This bug exists in MyFaces Core 1.1.6 and also in SVN trunk for 1.1.
This bug does not exists in 1.2.x. (The logic is moved to 
calculateCharacterEncoding method, and fixed there.)

Current Code:
----------------------------------------
if (characterEncoding == null) {
    HttpSession session = httpServletRequest.getSession(false);

    if (session != null) {
        characterEncoding = (String) 
session.getAttribute(ViewHandler.CHARACTER_ENCODING_KEY);
    }

    if (characterEncoding != null) {
        setCharacterEncodingMethod.invoke(servletRequest, new 
Object[]{characterEncoding});
    }
}
----------------------------------------
Should be fixed to:
----------------------------------------
if (characterEncoding == null) {
    HttpSession session = httpServletRequest.getSession(false);

    if (session != null) {
        characterEncoding = (String) 
session.getAttribute(ViewHandler.CHARACTER_ENCODING_KEY);
    }
}
if (characterEncoding != null) {
    setCharacterEncodingMethod.invoke(servletRequest, new 
Object[]{characterEncoding});
}
----------------------------------------


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to