You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Mark Struberg (JIRA)" <de...@myfaces.apache.org> on 2010/11/30 19:30:11 UTC

[jira] Created: (MYFACES-2984) Myfaces should return a proper contentType if ResourceWrapper doesn't return one.

Myfaces should return a proper contentType if ResourceWrapper doesn't return one.
---------------------------------------------------------------------------------

                 Key: MYFACES-2984
                 URL: https://issues.apache.org/jira/browse/MYFACES-2984
             Project: MyFaces Core
          Issue Type: Bug
          Components: JSR-314
    Affects Versions: 2.0.2
            Reporter: Mark Struberg


Since ResourceWrapper doesn't wrap getContentType (is not defined as abstract in the 2.0 spec) some component libraries (namely primefaces) do not return a proper content type. 

Currently MyFaces directly sets this value in ResourceHandlerImpl.java. In case the wrapper doesn't define an own content type, we end up passing null to the response. 

In this case the servlet container guesses the content type depending on the extension of the request URL. For the classic *.xhtml mapping we now get text/xhtml for each and every resource request (which leads to broken detection of css and images for example).

TODO: we should check if the wrapper returns null and ask the external context for the proper content type in this case.

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


[jira] Resolved: (MYFACES-2984) Myfaces should return a proper contentType if ResourceWrapper doesn't return one.

Posted by "Mark Struberg (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/MYFACES-2984?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mark Struberg resolved MYFACES-2984.
------------------------------------

    Resolution: Fixed

fixed by recursively 'unwrapping' the resourceName...

> Myfaces should return a proper contentType if ResourceWrapper doesn't return one.
> ---------------------------------------------------------------------------------
>
>                 Key: MYFACES-2984
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2984
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: JSR-314
>    Affects Versions: 2.0.2
>            Reporter: Mark Struberg
>            Assignee: Jakob Korherr
>             Fix For: 2.0.3-SNAPSHOT
>
>
> Since ResourceWrapper doesn't wrap getContentType (is not defined as abstract in the 2.0 spec) some component libraries (namely primefaces) do not return a proper content type. 
> Currently MyFaces directly sets this value in ResourceHandlerImpl.java. In case the wrapper doesn't define an own content type, we end up passing null to the response. 
> In this case the servlet container guesses the content type depending on the extension of the request URL. For the classic *.xhtml mapping we now get text/xhtml for each and every resource request (which leads to broken detection of css and images for example).
> TODO: we should check if the wrapper returns null and ask the external context for the proper content type in this case.

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


[jira] Resolved: (MYFACES-2984) Myfaces should return a proper contentType if ResourceWrapper doesn't return one.

Posted by "Jakob Korherr (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/MYFACES-2984?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jakob Korherr resolved MYFACES-2984.
------------------------------------

       Resolution: Fixed
    Fix Version/s: 2.0.3-SNAPSHOT

If getContentType() returns null or empty String determine it via ExternalContext.getMimeType().

> Myfaces should return a proper contentType if ResourceWrapper doesn't return one.
> ---------------------------------------------------------------------------------
>
>                 Key: MYFACES-2984
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2984
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: JSR-314
>    Affects Versions: 2.0.2
>            Reporter: Mark Struberg
>            Assignee: Jakob Korherr
>             Fix For: 2.0.3-SNAPSHOT
>
>
> Since ResourceWrapper doesn't wrap getContentType (is not defined as abstract in the 2.0 spec) some component libraries (namely primefaces) do not return a proper content type. 
> Currently MyFaces directly sets this value in ResourceHandlerImpl.java. In case the wrapper doesn't define an own content type, we end up passing null to the response. 
> In this case the servlet container guesses the content type depending on the extension of the request URL. For the classic *.xhtml mapping we now get text/xhtml for each and every resource request (which leads to broken detection of css and images for example).
> TODO: we should check if the wrapper returns null and ask the external context for the proper content type in this case.

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


[jira] Reopened: (MYFACES-2984) Myfaces should return a proper contentType if ResourceWrapper doesn't return one.

Posted by "Mark Struberg (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/MYFACES-2984?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mark Struberg reopened MYFACES-2984:
------------------------------------


now crashes with a NPE, because the getName is also not wrapped in ResourceWrapper...
Will fix this

> Myfaces should return a proper contentType if ResourceWrapper doesn't return one.
> ---------------------------------------------------------------------------------
>
>                 Key: MYFACES-2984
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2984
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: JSR-314
>    Affects Versions: 2.0.2
>            Reporter: Mark Struberg
>            Assignee: Jakob Korherr
>             Fix For: 2.0.3-SNAPSHOT
>
>
> Since ResourceWrapper doesn't wrap getContentType (is not defined as abstract in the 2.0 spec) some component libraries (namely primefaces) do not return a proper content type. 
> Currently MyFaces directly sets this value in ResourceHandlerImpl.java. In case the wrapper doesn't define an own content type, we end up passing null to the response. 
> In this case the servlet container guesses the content type depending on the extension of the request URL. For the classic *.xhtml mapping we now get text/xhtml for each and every resource request (which leads to broken detection of css and images for example).
> TODO: we should check if the wrapper returns null and ask the external context for the proper content type in this case.

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