MyFaces Core
  1. MyFaces Core
  2. MYFACES-3313

Calculation of redirect URL does not preserve the extension used in Faces Servlet mapping

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.2, 2.1.3
    • Fix Version/s: 2.0.10, 2.1.4
    • Component/s: None
    • Labels:
      None

      Description

      I have a simple navigation test case that does a navigation between two pages. Both pages have the same simple markup:

      <h:body>
      <h2>Page 01</h2>
      <h:form>
      <h:commandButton id="navButton"
      value="Nav"
      action="#

      {testBean.lastPage}

      " />
      </h:form>
      </h:body>

      The backing bean methods simply return the appropriate action outcome:

      public String lastPage()

      { return "lastPage"; }

      And the faces-config file has the following navigation rules:

      <navigation-rule>
      <from-view-id>*</from-view-id>
      <navigation-case>
      <from-outcome>lastPage</from-outcome>
      <to-view-id>/page02.jsf</to-view-id>
      <redirect/>
      </navigation-case>

      <navigation-case>
      <from-outcome>firstPage</from-outcome>
      <to-view-id>/page01.jsf</to-view-id>
      <redirect/>
      </navigation-case>
      </navigation-rule>

      The web.xml has a servlet mapping for .jsf files:

      <servlet-mapping>
      <servlet-name>Faces Servlet</servlet-name>
      <url-pattern>*.jsf</url-pattern>
      </servlet-mapping>

      If I go to the page01.jsf, the page loads fine. When I click the "Nav" button, the navigation occurs but the URL is page02.xhtml rather than page02.jsf. Because the extension is not preserved and there is no mapping for .xhtml in this case, the page doesn't get handled by the Faces Servlet. The current version of Mojarra (2.1.3) does preserve the extension when the redirect URL is encoded.

        Activity

        Deryk Sinotte created issue -
        Leonardo Uribe made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Leonardo Uribe [ lu4242 ]
        Fix Version/s 2.0.10 [ 12317870 ]
        Fix Version/s 2.1.4 [ 12317868 ]
        Resolution Fixed [ 1 ]
        Leonardo Uribe made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Leonardo Uribe
            Reporter:
            Deryk Sinotte
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development