DefaultViewHandlerSupport does not use the servlet path and path info request 
attributes when processing a Servlet/JSP include
------------------------------------------------------------------------------------------------------------------------------

                 Key: MYFACES-1877
                 URL: https://issues.apache.org/jira/browse/MYFACES-1877
             Project: MyFaces Core
          Issue Type: Bug
          Components: General
    Affects Versions: 1.2.3
            Reporter: Mathieu Vézeau


When MyFaces is processing a Servlet/JSP include, the method 
DefaultViewHandlerSupport.getFacesServletMapping() does not take into account 
the servlet path and path info that are passed as request attributes (namely, 
javax.servlet.include.servlet_path and javax.servlet.include.path_info). 
Instead, the method takes the values directly from 
externalContext.getRequestServletPath() and 
externalContext.getRequestPathInfo(), ignoring the request attributes that 
could overwrite them. However, these attributes are taken into account when the 
original view id is calculated (see 
DefaultRestoreViewSupport.calculateViewId()), so there seems to be a mismatch 
between these two behaviors.

As a result, in situations where the servlet path or path info passed as 
request attributes are different from their original values in the request, 
MyFaces may not be able to find the appropriate mapping and may also skip the 
suffix substitution even when it should occur (see 
DefaultViewHandlerSupport.calculateViewId()). But since the original view id 
was calculated correctly as explained above, using the attribute overwrites, 
but the suffix .jsf is not changed to .jsp as it should, it results in an 
infinite loop as MyFaces keeps calling itself instead of calling the JSP 
processor.

The solution is to modify DefaultViewHandlerSupport.getFacesServletMapping() to 
take into account the servlet path / path info request attributes just like 
DefaultRestoreViewSupport.calculateViewId() does.

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