You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-dev@portals.apache.org by "David DeWolf (JIRA)" <ji...@apache.org> on 2006/12/05 15:27:06 UTC

[jira] Updated: (PLUTO-240) Declared charset ignored when setting render response content type

     [ http://issues.apache.org/jira/browse/PLUTO-240?page=all ]

David DeWolf updated PLUTO-240:
-------------------------------

    Affects Version/s: 1.2.0
             Priority: Minor  (was: Major)

> Declared charset ignored when setting render response content type
> ------------------------------------------------------------------
>
>                 Key: PLUTO-240
>                 URL: http://issues.apache.org/jira/browse/PLUTO-240
>             Project: Pluto
>          Issue Type: Bug
>    Affects Versions: 1.2.0
>            Reporter: Tuomas Kiviaho
>            Priority: Minor
>
> Here's a snippet from RenderResponseImpl
>     public void setContentType(String contentType)
>       throws IllegalArgumentException {
>     	ArgumentUtility.validateNotNull("contentType", contentType);
>         String mimeType = StringUtils.getMimeTypeWithoutEncoding(contentType);
>         if (!isValidContentType(mimeType)) {
>             throw new IllegalArgumentException("Specified content type '"
>             		+ mimeType + "' is not supported.");
>         }
>         getHttpServletResponse().setContentType(mimeType);
>         this.currentContentType = mimeType;
>     }
> When mime is used as content type, the optional charset part of contentType is ignored. Should there be raised an java.lang.IllegalArgumentException if charset is appended or should the render response characterset part be fed with the contentType charset part. 
> The API is not too clear what to do here, but using JSP directive...
> <jsp:directive.page contentType="image/svg+xml;charset=UTF-8" />
> .. and receiving default encoding in response header without a warning is quite error prone. 
> The 1:1 functionality with HttpServletResponse is the working solution, since at least Apache Jasper seems to use setContentType instead of setCharacterEncoding. 
> I don't know if the Render response MIME is allowed to include charset, but at least RenderResponseImpl#getContentType had a comment saying:
>         // NOTE: in servlet 2.4 we could simply use this:
>         //   return super.getHttpServletResponse().getContentType();

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira