Uploaded image for project: 'MyFaces Trinidad'
  1. MyFaces Trinidad
  2. TRINIDAD-1656

Maven-faces-plugin faces-config.xml generation does not allow ViewRoot replacement

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.2.10-plugins
    • 1.2.11-plugins
    • Plugins
    • None

    Description

      I am using the maven-faces-plugin (GenerateFacesConfigMojo) to generate my faces-config.xml.

      Unfortunately, I need to make use of my own UIViewRoot implementation. As such, in my base faces-config.xml file, I explicitly specify a component mapping for the javax.faces.ViewRoot component type, eg:

      <component>
      <component-type>javax.faces.ViewRoot</component-type>
      <component-class>org.example.component.SomeViewRoot</component-class>
      </component>

      While the maven-faces-plugin passes other component mappings defined my my base faces-config.xml file through to the generated file, my javax.faces.ViewRoot mapping is ignored due to the following restriction in transform12.xsl:

      <xsl:apply-templates select="javaee:component[not(contains(javaee:component-extension/mfp:component-class-modifier/text(), 'abstract')) and
      starts-with(javaee:component-type, $typePrefix)]" />

      The issue is that only component mappings for component-types that match the $typePrefix are accepted. Normally this is fine, but in this case I need to allow a mapping outside of my $typePrefix through.

      A one-off fix for this problem that would meet my needs would be to also allow javax.faces.ViewRoot component mappings to pass through as well, eg:

      <xsl:apply-templates select="javaee:component[not(contains(javaee:component-extension/mfp:component-class-modifier/text(), 'abstract')) and
      (starts-with(javaee:component-type, $typePrefix) or
      (contains(javaee:component-type, 'javax.faces.ViewRoot')))]" />

      This is a bit hokey, since it special cases a single component type, but seems like the least impact/risky change that meet my needs.

      Can we implement this solution or something equivalent?

      Attachments

        1. TRINIDAD-1656.patch
          1 kB
          Andy Schwartz

        Activity

          People

            matzew Matthias Wessendorf
            andy.schwartz Andy Schwartz
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: