You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Volodymyr Siedlecki (Jira)" <de...@myfaces.apache.org> on 2022/12/08 22:00:00 UTC

[jira] [Commented] (MYFACES-4524) Generate Proper Resource Paths

    [ https://issues.apache.org/jira/browse/MYFACES-4524?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17645001#comment-17645001 ] 

Volodymyr Siedlecki commented on MYFACES-4524:
----------------------------------------------

I should explain the fix -- by creating an exact match mapping, the resource handling will differ.

The code will enter this if block here due the new match: 
https://github.com/apache/myfaces/blob/93a47f3c78716f0ff3c01227ee1cd5972aeb965b/impl/src/main/java/org/apache/myfaces/resource/ResourceImpl.java#L118-L122

The getGenericPrefixOrSuffixMapping fallback will generate a mapping to the faces servlet. 

> Generate Proper Resource Paths
> ------------------------------
>
>                 Key: MYFACES-4524
>                 URL: https://issues.apache.org/jira/browse/MYFACES-4524
>             Project: MyFaces Core
>          Issue Type: Bug
>    Affects Versions: 2.2.14, 2.3.10, 2.3-next-M7, 3.0.2, 4.0.0-RC2
>            Reporter: Volodymyr Siedlecki
>            Priority: Major
>         Attachments: jsf_appl_resource_web.war
>
>
> The TCK tested incorrect resource paths which means MyFaces has been incorrect the whole time (along with Mojarra until 4.0.0).
> For non faces requests, the resource path (using the attached TCK app) would be generated like this: 
> {noformat}
> /jsf_appl_resource_web/TestServlet/jakarta.faces.resource/duke-boxer.gif?ln=images
> {noformat}
>  where TestServlet is the servlet mapping.   However, the correct path should use the appropriate faces mapping instead (i.e prefix with /faces/ or use the xhtml extension) 
> You can read BalusC's reply in this issue: https://github.com/jakartaee/faces/issues/1663
> Additionally, Mojarra updated to use Servlet 4 API Mappings (https://github.com/eclipse-ee4j/mojarra/pull/4956), and it might be good for us to update to that as well.  I'll create a separate JIRA -- MYFACES-4525)



--
This message was sent by Atlassian Jira
(v8.20.10#820010)