javaserverfaces-spec-public
  1. javaserverfaces-spec-public
  2. JAVASERVERFACES_SPEC_PUBLIC-121

Require ordering of for loading META-INF/faces-config.xml files from component jar

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.2 Sprint 8
    • Fix Version/s: 2.0
    • Component/s: Uncategorized
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: Sun

    • Issuezilla Id:
      121
    • Status Whiteboard:
      Hide

      EGTop5 effort_hard

      Show
      EGTop5 effort_hard

      Description

      Martin Marinschek from MyFaces brought this one to me via Jesse Alexander from
      Credit Suisse. I think it makes sense to fix it.

      JSF Requires all items in the enumeration returned by

      getCurrentClassLoader().getResources("/META-INF/faces-config.xml") to be parsed
      into the config system.

      The ordering is unspecified.

      I propose we state that the files be loaded in the following order.

      For each resource, jarResource in the Enumeration returned from
      getCurrentClassLoader().getResources("/META-INF/faces-config.xml")

      • Declare a SortedMap<String,URL> sortedJarMap.
      • Declare a List<URL> unsortedResourceList.
      • If possible, derive the name of the jar file, jarName, from which this
        jarResource is to be loaded using the following algorithm.

      1. get the String value of the full URL of the resource, call it
      jarUrl.

      2. Get the index j of the String "/META-INF/faces-config.xml" within
      jarUrl. If found, search for the index i of the first
      File.SEPARATOR instance before the index.

      3. jarName is jarUrl.substring(i+1, j).

      Add the jarName to sortedJarMap: sortedJarMap.put(jarName, jarResource).

      • If the jarName cannot be found using the above algorithm, simply add
        the jarResource to unsortedResourceList:
        unsortedResourceList.add(jarResource).

      Once all the resources have been discovered, load each one into faces in
      the following order.

      1. The resources from sortedJarMap

      2. The resources from unsortedResourceList

      1. ConfigureListener.java
        74 kB
        Ed Burns
      2. ConfigureListener.java
        49 kB
        Ed Burns

        Issue Links

          Activity

          Hide
          Ed Burns added a comment -

          11.4.6 Make sure to add logging requirements on the "<ordering> element
          in the applicationFacesConfig" and the "<absolute-ordering> element in a
          member of applicationConfigurationResources".

          11.4.6 paragraph 4

          Make so that multiple entries in applicationConfigurationResources
          with the same name cause a deployment failure.

          11.4.6

          Add another example that shows there is more than one possible
          ordering result given the algorithm and the same inputs.

          Same is true for absolute ordering example

          11.4.6

          11-23 Suggest again to EG that circular references cause a failure to
          deploy.

          Show
          Ed Burns added a comment - 11.4.6 Make sure to add logging requirements on the "<ordering> element in the applicationFacesConfig" and the "<absolute-ordering> element in a member of applicationConfigurationResources". 11.4.6 paragraph 4 Make so that multiple entries in applicationConfigurationResources with the same name cause a deployment failure. 11.4.6 Add another example that shows there is more than one possible ordering result given the algorithm and the same inputs. Same is true for absolute ordering example 11.4.6 11-23 Suggest again to EG that circular references cause a failure to deploy.
          Hide
          Ed Burns added a comment -

          Fixed

          Show
          Ed Burns added a comment - Fixed
          Hide
          Ed Burns added a comment -

          Fixed

          Show
          Ed Burns added a comment - Fixed
          Hide
          Ed Burns added a comment -

          Prepare to delete "spec" subcomponent.

          Show
          Ed Burns added a comment - Prepare to delete "spec" subcomponent.
          Hide
          Manfred Riem added a comment -

          Closing resolved issue out

          Show
          Manfred Riem added a comment - Closing resolved issue out

            People

            • Assignee:
              Ed Burns
              Reporter:
              Ed Burns
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: