Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-2127

duplicated component id with any jsp:include (or other inclusion) of jsf pages

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 1.2.5
    • None
    • General
    • None

    Description

      Any type of page inclusion seems to lead to duplicated component id and thus fails with MyFaces 1.2. E.g. something like this (with appropriate taglibs):

      outer.jsp:
      <f:view>
      <jsp:include page="inner.jsp"/>
      </f:view>

      inner.jsp:
      <h:inputText value="foo"/>

      gives me error:
      java.lang.IllegalStateException - Client-id : j_id_id0 is duplicated in the faces tree. Component

      Both the outer view and the inner inputText are assigned the same "id0" as jspId. However, documentation on setJspId on page http://java.sun.com/javaee/5/docs/api/javax/faces/webapp/UIComponentClassicTagBase.html#setJspId(java.lang.String), to which MyFaces sources refer, notes that:

      IMPLEMENTATION NOTE: This method will detect where we are in an include and assign a unique ID for each include in a particular 'logical page'. This allows us to avoid possible duplicate ID situations for included pages that have components without explicit IDs.

      This is not true for MyFaces, which renders code reusal (which jsp inclusion facilitates) impossible for this case. Or at least I don't see how to include pages without causing errors.

      Attachments

        Issue Links

          Activity

            People

              lu4242 Leonardo Uribe
              doublep Paul Pogonyshev
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: