MyFaces Core
  1. MyFaces Core
  2. MYFACES-3454

composite component is not rendered anymore with 2.1.6-SNAPSHOT

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.1.6-SNAPSHOT
    • Fix Version/s: 2.0.12, 2.1.6
    • Component/s: None
    • Labels:
      None

      Description

      If you use myfaces 2.1.6-SNAPSHOT, a composite component is not rendered correctly anymore. With myfaces-2.1.5 everything is ok.
      A testcase to reproduce this issue is attached.

      http://localhost:8080/jsftest/componenttest.jsf

      1. jsftest.war
        3.92 MB
        Rene O

        Issue Links

          Activity

          Hide
          Leonardo Uribe added a comment - - edited

          JSF 2.0 spec section 2.6.1.3 Resource Identifiers says this about libraryName :

          "... The run-time must enforce the following rules to consider a <resourceIdentifier>s valid. A <resourceIdentifier> that does not follow these rules must not be considered valid and must be ignored silently.

          • The set of characters that are valid for use in the localePrefix, libraryName, and resourceVersion segments of the resource identifier is specififed as XML NameChar excluding the path separator and ‘:’ characters. The specification for XML NameChar may be seen at http://www.w3.org/TR/REC-xml/#NT-NameChar."
          • A further restriction applies to libraryName. A libraryName must not be an underscore separated sequence of non-negative integers or a locale string. More rigorously, a libraryName must not match either of the following regular expressions:

          [0-9](_[0-9])*
          [A-Za-z]

          {2}(_[A-Za-z]{2}

          (_[A-Za-z]+)*)?

          ..."

          so any libraryName that contain slashes like in the example (components/mycomp) is considered invalid.

          Show
          Leonardo Uribe added a comment - - edited JSF 2.0 spec section 2.6.1.3 Resource Identifiers says this about libraryName : "... The run-time must enforce the following rules to consider a <resourceIdentifier>s valid. A <resourceIdentifier> that does not follow these rules must not be considered valid and must be ignored silently. The set of characters that are valid for use in the localePrefix, libraryName, and resourceVersion segments of the resource identifier is specififed as XML NameChar excluding the path separator and ‘:’ characters. The specification for XML NameChar may be seen at http://www.w3.org/TR/REC-xml/#NT-NameChar ." A further restriction applies to libraryName. A libraryName must not be an underscore separated sequence of non-negative integers or a locale string. More rigorously, a libraryName must not match either of the following regular expressions: ■ [0-9] (_ [0-9] )* ■ [A-Za-z] {2}(_ [A-Za-z] {2} (_ [A-Za-z] +)*)? ..." so any libraryName that contain slashes like in the example (components/mycomp) is considered invalid.
          Hide
          Rene O added a comment -

          Now the question is, how can i keep my tidy project folder structure?
          I have in my webapp folders like this: resources -> components -> mycomp -> mycomponent.xhtml which leads to the usage of the incorrect namespace:
          xmlns:mycomp="http://java.sun.com/jsf/composite/components/mycomp"

          Is there a workaround for this or am i forced by the spec to use a folder structure like this: resources -> mycomponents -> mycomponent.xhtml ?

          Show
          Rene O added a comment - Now the question is, how can i keep my tidy project folder structure? I have in my webapp folders like this: resources -> components -> mycomp -> mycomponent.xhtml which leads to the usage of the incorrect namespace: xmlns:mycomp="http://java.sun.com/jsf/composite/components/mycomp" Is there a workaround for this or am i forced by the spec to use a folder structure like this: resources -> mycomponents -> mycomponent.xhtml ?
          Hide
          Leonardo Uribe added a comment -

          You can add a file under your WEB-INF folder ending with .taglib.xml (for example mycomp.taglib.xml) with this content:

          <facelet-taglib xmlns="http://java.sun.com/xml/ns/javaee"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facelettaglibrary_2_0.xsd"
          version="2.0">

          <namespace>http://java.sun.com/jsf/composite/components/mycomp</namespace>
          <composite-library-name>components.mycomp</composite-library-name>

          </facelet-taglib>

          and create a folder called components.mycomp and add your files there.

          Show
          Leonardo Uribe added a comment - You can add a file under your WEB-INF folder ending with .taglib.xml (for example mycomp.taglib.xml) with this content: <facelet-taglib xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facelettaglibrary_2_0.xsd " version="2.0"> <namespace> http://java.sun.com/jsf/composite/components/mycomp </namespace> <composite-library-name>components.mycomp</composite-library-name> </facelet-taglib> and create a folder called components.mycomp and add your files there.
          Hide
          Rene O added a comment -

          Thank you for the information.

          Show
          Rene O added a comment - Thank you for the information.
          Hide
          Werner Punz added a comment - - edited

          It makes more sense to keep a config param to enable this behavior upon the users request.
          So I reopen this issue again.

          Show
          Werner Punz added a comment - - edited It makes more sense to keep a config param to enable this behavior upon the users request. So I reopen this issue again.
          Hide
          Leonardo Uribe added a comment -

          Added this web config param.

          /**

          • Allow slash in the library name of a Resource.
            */
            @JSFWebConfigParam(since="2.1.6, 2.0.12", defaultValue="false", expectedValues="true, false", group="resources")
            public static final String INIT_PARAM_STRICT_JSF_2_ALLOW_SLASH_LIBRARY_NAME = "org.apache.myfaces.STRICT_JSF_2_ALLOW_SLASH_LIBRARY_NAME";
          Show
          Leonardo Uribe added a comment - Added this web config param. /** Allow slash in the library name of a Resource. */ @JSFWebConfigParam(since="2.1.6, 2.0.12", defaultValue="false", expectedValues="true, false", group="resources") public static final String INIT_PARAM_STRICT_JSF_2_ALLOW_SLASH_LIBRARY_NAME = "org.apache.myfaces.STRICT_JSF_2_ALLOW_SLASH_LIBRARY_NAME";

            People

            • Assignee:
              Leonardo Uribe
              Reporter:
              Rene O
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development