Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Conditional include in JSF

843842Jan 31 2007 — edited Nov 5 2009
I've been trying to make a conditional include in a jsf page just like:
      <%
          if ( condition ) {
      %>
      <h:form>
          <jsp:include page="page1.jsp"/>  
      </h:form> 
      <%
            }
      %>
When condition is true everythings is ok. However when condition is false I always get an exception like:
javax.servlet.ServletException: cannot add component with id 'p_1' and path :
{Component-Path : [Class: com.exadel.htmLib.components.UIP,Id: p_1]} 
to its parent component. This might be a problem due to duplicate ids.
I guess that the component tree just cannot be rebuilt successfully when the page is not included.

Any ideas?

Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 3 2009
Added on Jan 31 2007
9 comments
1,757 views