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

Leonardo Uribe commented on MYFACES-1794:
-----------------------------------------

Thanks for the test. That's the spirit! ;-) 

The error is on trinidad, not in myfaces. I tried the test with ri 1.2_14 and 
it fails too.

In trinidad there is a class called 
org.apache.myfaces.trinidadinternal.renderkit.core.pages.GenericEntry . This 
one has a method called getGenericEntryPath that has this code:

  static public String getGenericEntryPath(FacesContext context)
  {
    String url = context.getApplication().getViewHandler().
      getActionURL(context, _GENERIC_ENTRY_VIEW_ID);

    return url;
  }

  static private final String _GENERIC_ENTRY_VIEW_ID = "/__ADFv__";

It delegates to the default view handler, Both trinidad and facelets does not 
override this method, so in myfaces this is handled by JspViewHandlerImpl. 

JSF 1.2 rev A spec section 7.5.2 Default ViewHandler Implementation says the 
following about ViewHandler.getActionURL:

"....The getActionURL() method must fulfill the following responsibilities:
■ If the specified viewId does not start with a "/", throw
IllegalArgumentException.
■ If prefix mapping (such as "/faces/*") is used for FacesServlet, prepend the 
context
path of the current application, and the specified prefix, to the specified 
viewId and return
the completed value. For example "/cardemo/faces/chooseLocale.jsp".
■ If suffix mapping (such as "*.faces") is used for FacesServlet, and the 
specified
viewId ends with the specified suffix, replacing the suffix with the value 
specified by the
context initialization parameter named by the symbolic constant
ViewHandler.DEFAULT_SUFFIX_NAME (if no such context initialization parameter
is present, use the value of the symbolic constant ViewHandler.DEFAULT_SUFFIX 
as the
replacement suffix), prefix this value with the context path for the current web
application, and return the result. For example "/cardemo/chooseLocale.faces"  
....."

Trinidad does not append the default suffix to the constant, so when extension 
mapping is used the algorithm of the spec does not replace the expected suffix, 
just append the constant to the url, causing the 404 error. 

The wrong link is rendered like this:

http://localhost:8080/myfaces-test-trinidad/__ADFv__?_t=cd&value=1233532799700&loc=es&enc=iso-8859-1

and it should be rendered like this:

http://localhost:8080/myfaces-test-trinidad/__ADFv__.jsf?_t=cd&value=1233532799700&loc=es&enc=iso-8859-1

Could you open an issue on trinidad issue tracker and reference this issue, so 
someone in trinidad could commit the solution proposed?

> MF Core causes resources not found(404) errors (recently also corrected in 
> Sun RI for JSF 1.2)
> ----------------------------------------------------------------------------------------------
>
>                 Key: MYFACES-1794
>                 URL: https://issues.apache.org/jira/browse/MYFACES-1794
>             Project: MyFaces Core
>          Issue Type: Bug
>    Affects Versions:  1.2.0
>         Environment: JSF 1.2 (failures mostly happen with extensions like 
> with Trinidad e.g.)
>            Reporter: Wolf Benz
>            Assignee: Leonardo Uribe
>         Attachments: 404_2.jpg, 404ResourcesExample.war, 404Screenshot.jpg
>
>
> Cf. the MF mailing list: topics like "Dialog issue during ADF->Trinidad 
> migration"
> I came across it using tr:inputDate but in the list topic I mentioned above, 
> so I first thought it was a Trinidad issue, but people more knowledgeable 
> with the JSF spec(Adam Winer) pointed out it was a MF 1.2 core issue, and 
> that the Sun RI had also sufferend from it, yet in the RI, this bug has 
> recently been corrected. 
> The error I got was when clicking the calendar icon and expecting a cal 
> popup. Instead I got: 
> "description The requested resource (.../__ADFv__.jsp) is not available."
> As it potentially affects a lot of other components beyond this trinidad one, 
> I marked it major as these components just don't work anymore.
> E.g. MF mailing list with topic "RE: [Trinidad] HTTP 404 (file not found) 
> while using DialogFramework" points that out.
> --Wolf

-- 
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