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

                 Key: MYFACES-2127
                 URL: https://issues.apache.org/jira/browse/MYFACES-2127
             Project: MyFaces Core
          Issue Type: Bug
          Components: General
    Affects Versions: 1.2.5
            Reporter: Paul Pogonyshev


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.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to