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

Cannot create friendly JSF Resource URLs which include {javax.faces.resource} and {ln}

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • bridge-ext-1.0.0, bridge-ext-2.0.0, bridge-ext-3.0.0, bridge-ext-5.0.0
    • bridge-ext-5.1.2
    • None

    Description

      Steps to reproduce:

      1. Add the following to the jsf-showcase-porltet friendly-url-routes.xml:
         <route>
             <pattern>/javax.faces.resource/{javax.faces.resource}?ln={ln}</pattern>
             <ignored-parameter name="p_p_id" />
             <ignored-parameter name="p_p_state" />
             <ignored-parameter name="p_p_mode" />
             <ignored-parameter name="p_p_cacheability" />
             <ignored-parameter name="p_p_col_id" />
             <ignored-parameter name="p_p_col_count" />
             <implicit-parameter name="p_p_lifecycle">2</implicit-parameter>
         </route>
        
      1. Deploy the showcase and test-setup-hook.
      2. Navigate to this URL: http://localhost:8080/web/guest/jsf-showcase/-/jsf-tag/javax.faces.resources/jsf.js?ln=javax.faces

      If the bug is fixed, the contents of jsf.js will appear in the browser.

      If the bug still exists, the JSF showcase home page will appear in the browser.

      Note: When this issue is fixed, the resource deduplication code in LiferaySharedPageTop should be modified to be able to parse configured friendly resource URLs to obtain resource names and libraries. Also, a bridge-ext ResourceHandler should be added to the ResourceHandler chain that @Override s isResourceURL() to detect if a friendly URL is a JSF resource URL.

      Workaround

      The most friendly URL pattern that can currently create for JSF resources is the following:

      <route>
          <pattern>/{instanceId}</pattern> <!-- if your portlet is instanceable=false, then you can remove the {instanceId} from this pattern -->
          <ignored-parameter name="p_p_id" />
          <ignored-parameter name="p_p_state" />
          <ignored-parameter name="p_p_mode" />
          <ignored-parameter name="p_p_cacheability" />
          <ignored-parameter name="p_p_col_id" />
          <ignored-parameter name="p_p_col_count" />
          <implicit-parameter name="p_p_lifecycle">2</implicit-parameter>
      </route>
      

      That pattern will generate URLs like this: http://localhost:8080/web/guest/jsf-showcase/-/jsf-tag?portletNamespace_javax.faces.resource=jsf.js&portletNamespace_ln=javax.faces

      Note that this will apply to all resource URLs for the portlet, not just JSF resources since it does not and cannot include theĀ {javax.faces.resource} and {ln} parameters.

      Attachments

        Activity

          People

            neil.griffin Neil Griffin
            kyle.stiemann Kyle Stiemann (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:

              Packages

                Version Package
                bridge-ext-5.1.2