Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
1.2.5
-
None
-
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
- duplicates
-
MYFACES-1834 suffix added to component id when including files
- Closed