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

  • SEARCH
  • Home
  • 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 7960497
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:46:14+00:00 2026-06-04T04:46:14+00:00

I need to create a layout like this but with all the containers on

  • 0

I need to create a layout like this but with all the containers on separated files, like:

top.xhtml

<p:layout fullPage="true">
        <p:layoutUnit position="north" header="#{support.applicationTitle}">
            <h:form>
                <p:menubar>
                    <p:menuitem value="Quit" icon="ui-icon-close" action="#{userController.logOut()}" />
                </p:menubar>
            </h:form>
        </p:layoutUnit>

Without the </p:layout> because it will be close on my footer.xhtml like:

<p:layoutUnit position="south" header="© 2012 - 2012 PORTAL DE IDEIAS">
</p:layoutUnit></p:layout>

I have tried with both files but I get a error telling me that I need to close the layout tag, what is correct, but how can I solve my problem? Is this the best approach for a template? And another problem is that the layout tag require a center layoutUnit

  • 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-06-04T04:46:16+00:00Added an answer on June 4, 2026 at 4:46 am

    This is indeed not the right approach. Your template has to be XML well formed. I suggest to create a master template file instead if all you want is to only specify the center unit.

    Taking the example on the showcase site, that should look like this:

    /WEB-INF/templates/layout.xhtml

    <!DOCTYPE html>
    <html lang="en"
         xmlns="http://www.w3.org/1999/xhtml"
         xmlns:f="http://java.sun.com/jsf/core"
         xmlns:h="http://java.sun.com/jsf/html"
         xmlns:ui="http://java.sun.com/jsf/facelets"
         xmlns:p="http://primefaces.org/ui"
    >
        <h:head>
            <title>Title</title>
        </h:head>
        <h:body>
            <p:layout fullPage="true">
                <p:layoutUnit position="north" size="100" header="Top" resizable="true" closable="true" collapsible="true">
                    <h:outputText value="Top unit content." />
                </p:layoutUnit>
    
                <p:layoutUnit position="south" size="100" header="Bottom" resizable="true" closable="true" collapsible="true">
                    <h:outputText value="South unit content." />
                </p:layoutUnit>
    
                <p:layoutUnit position="west" size="200" header="Left" resizable="true" closable="true" collapsible="true">
                    <h:form>
                        <ui:include src="../templates/themeMenu.xhtml" />
                    </h:form>
                </p:layoutUnit>
    
                <p:layoutUnit position="east" size="200" header="Right" resizable="true" closable="true" collapsible="true" effect="drop">
                    <h:outputText value="Right unit content." />
                </p:layoutUnit>
    
                <p:layoutUnit position="center">
                    <ui:insert name="content">Put default content here, if any.</ui:insert>
                </p:layoutUnit>
            </p:layout>
        </h:body>
    </html>
    

    Note the <ui:insert> in the center unit.

    The template client can then just look like this:

    /page.xhtml

    <ui:composition template="/WEB-INF/templates/layout.xhtml"
         xmlns="http://www.w3.org/1999/xhtml"
         xmlns:f="http://java.sun.com/jsf/core"
         xmlns:h="http://java.sun.com/jsf/html"
         xmlns:ui="http://java.sun.com/jsf/facelets"
         xmlns:p="http://primefaces.org/ui"
    >
         <ui:define name="content">
             <p>Here goes your view-specific content.</p>
         </ui:define>
    </ui:composition>
    

    which you open by http://example.com/contextname/page.xhtml.

    See also:

    • How to include another XHTML in XHTML using JSF 2.0 Facelets?

    If you’re looking for live open source examples of advanced Facelets templating, you may find OmniFaces showcase app useful.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to create this layout and I'd like to do as much of
I would like to create this layout in Silverlight. The text need to wrap
I would like to create a new lightswitch shell(because I need another layout than
I need to create a layout like below. And I worked out how to
I need to create the following layout: +--------+----------------------------------+-----------+ | fixed | variable | variable
I need to create text field which takes 70% of layout's width (in linear
I need create custom tabbar with super class UITabBarController. But i don,t know how
I need create clone repository. but I do not know where can I get
I am using a Miglayout to create a table-like layout for one of my
I need to create an Android horizontal layout design with a vertical LinearLayout on

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.