Uploaded image for project: 'PUBLIC - Liferay Faces'
  1. PUBLIC - Liferay Faces
  2. FACES-3298

The bridge only allows the first extension mapping to be used

    Details

      Description

      Steps to reproduce:

      1. Replace the jsf-applicant web.xml <servlet-mapping> with the following:
         <servlet-mapping>
             <servlet-name>Faces Servlet</servlet-name>
             <url-pattern>*.faces</url-pattern>
             <url-pattern>*.jsf</url-pattern>
             <url-pattern>*.view</url-pattern>
             <url-pattern>*.x</url-pattern>
             <url-pattern>*.xhtml</url-pattern>
         </servlet-mapping>
        
      2. Deploy and navigate to the JSF applicant portlet.
      3. Change the URL to: http://localhost:8080/group/bridge-demos/jsf-applicant?p_p_id=1_WAR_comliferayfacesdemojsfapplicantportlet_INSTANCE_ABCD&_facesViewIdRender=/WEB-INF/views/portletViewMode.jsf

      If the bug still exists, "JSF Applicant Portlet is temporarily unavailable." will appear in the browser, and the following error will appear in the server logs:

      2018-05-25 21:32:39.507 ERROR [http-nio-8080-exec-3][render_portlet_jsp:131] null
      javax.faces.FacesException: The FacesServlet cannot have a url-pattern of /*.  Please define a different url-pattern.
              at com.sun.faces.application.view.JspViewHandlingStrategy.executePageToBuildView(JspViewHandlingStrategy.java:329)
              at com.sun.faces.application.view.JspViewHandlingStrategy.buildView(JspViewHandlingStrategy.java:153)
              at javax.faces.view.ViewDeclarationLanguageWrapper.buildView(ViewDeclarationLanguageWrapper.java:106)
              at com.liferay.faces.bridge.application.view.internal.ViewDeclarationLanguageBridgeBase.buildView(ViewDeclarationLanguageBridgeBase.java:56)
              at com.liferay.faces.bridge.application.view.internal.ViewDeclarationLanguageBridgeJspImpl.buildView(ViewDeclarationLanguageBridgeJspImpl.java:90)
              at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:99)
              at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
              at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219)
              at com.liferay.faces.bridge.internal.BridgePhaseHeaderRenderCommon.executeRender(BridgePhaseHeaderRenderCommon.java:220)
              at com.liferay.faces.bridge.internal.BridgePhaseRenderCompatImpl.execute(BridgePhaseRenderCompatImpl.java:57)
              at com.liferay.faces.bridge.internal.BridgePhaseRenderImpl.execute(BridgePhaseRenderImpl.java:57)
              at com.liferay.faces.bridge.internal.BridgeImpl.doFacesRequest(BridgeImpl.java:161)
              at javax.portlet.faces.GenericFacesPortlet.doView(GenericFacesPortlet.java:753)
              at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:359)
              at javax.portlet.faces.GenericFacesPortlet.doDispatch(GenericFacesPortlet.java:669)
              at javax.portlet.GenericPortlet.render(GenericPortlet.java:262)
              at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:103)
              at com.liferay.portlet.ScriptDataPortletFilter.doFilter(ScriptDataPortletFilter.java:57)
              at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:100)
              at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:64)
      

      If the bug is fixed, the portlet's view mode will be rendered correctly.

      Additional Notes:

      If the .xhtml mapping appears first, none of the other mappings will work. If another mapping appears first, the first mapping will work and .xhtml mapping will work, but none of the other mappings will work.

      For example, .faces and .xhtml will work correctly with the following mapping:

      <servlet-mapping>
          <servlet-name>Faces Servlet</servlet-name>
          <url-pattern>*.faces</url-pattern>
          <url-pattern>*.jsf</url-pattern>
          <url-pattern>*.view</url-pattern>
          <url-pattern>*.x</url-pattern>
          <url-pattern>*.xhtml</url-pattern>
      </servlet-mapping>
      

      But only *.xhtml will work correctly with the following mapping:

      <servlet-mapping>
          <servlet-name>Faces Servlet</servlet-name>
          <url-pattern>*.xhtml</url-pattern>
          <url-pattern>*.faces</url-pattern>
          <url-pattern>*.jsf</url-pattern>
          <url-pattern>*.view</url-pattern>
          <url-pattern>*.x</url-pattern>
      </servlet-mapping>
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                kyle.stiemann Kyle Stiemann
                Reporter:
                kyle.stiemann Kyle Stiemann
                Participants of an Issue:
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated: