Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6879939
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:54:38+00:00 2026-05-27T04:54:38+00:00

I am using JSF 2.0 and PrimeFaces 2.2.1. In my template.xhtml, I have a

  • 0

I am using JSF 2.0 and PrimeFaces 2.2.1. In my template.xhtml, I have a ui:insert component:

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.prime.com.tr/ui">
   <h:head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
      <title>A page</title>
   </h:head>

   <h:body>
      <ui:insert name="content"></ui:insert>
   </h:body>
</html>

In myPage.xhtml which uses the above template, I defined a <p:layout> component as following:

<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                template="./../template/template.xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                xmlns:f="http://java.sun.com/jsf/core">

   <ui:define name="content">
      <p:layout>
         <p:layoutUnit position="center">  
            Center unit
         </p:layoutUnit>

         <p:layoutUnit position="right" collapsible="true">  
            Right unit
         </p:layoutUnit>  
      </p:layout> 
   </ui:define>

</ui:composition>

When I opened myPage.xhtml, I saw “Center unit” and “Right unit” but I didn’t see any layout rendered.

However, when I tried to put the <p:layout> component inside the template as following:

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.prime.com.tr/ui">
   <h:head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
      <title>A page</title>
   </h:head>

   <h:body>
      <p:layout>
         <p:layoutUnit position="center">  
            <ui:insert name="center"></ui:insert>
         </p:layoutUnit>

         <p:layoutUnit position="right" collapsible="true">  
            <ui:insert name="right"></ui:insert>
         </p:layoutUnit>  
      </p:layout> 

   </h:body>
</html>

everything works perfectly. Any pages that use the 2nd template rendered the component as expected.

I’d be very grateful if someone could tell me what I have done wrong with the 1st template.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T04:54:39+00:00Added an answer on May 27, 2026 at 4:54 am

    I don’t believe that it is possible to use <p:layout> within <ui:define>.

    You can use a <ui:insert> within a <p:layoutUnit> however:

    <p:layout>
        <p:layoutUnit position="center">
               <ui:insert name="Center unit" />
        </p:layoutUnit>
        <p:layoutUnit position="right" collapsible="true">
               <ui:insert name="Right unit" />
        </p:layoutUnit>
    </p:layout>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Eclipse to work with PrimeFaces like this: <ui:composition xmlns=http://www.w3.org/1999/xhtml xmlns:ui=http://java.sun.com/jsf/facelets xmlns:h=http://java.sun.com/jsf/html
I have a problem using JSF 2.0, PrimeFaces and the tuckey.org UrlRewriteFilter. The problem
I'm using JSF 2.0 and PrimeFaces library. I have a page with several inputs
I am using JSF 2.0 and PrimeFaces. I have a selectOneMenu and a selectManyCheckbox.
I am using primefaces with JSF. I need a input component that allows users
Hi there Im just learning JSF 2 using Primefaces. I have a question regarding
I'm using JSF 2.0 and primefaces. I have one page with several inputs inside
I am using JSF 2.0 and PrimeFaces 2.2. I have a data table whose
Can I use jsf component libraries(primefaces) with spring mvc .I have problem with client
I'm using JSF 2 and PrimeFaces 2.1 on GlassFish. I have a page that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.