Skip to main content

JSF Tip #37 - Create a composite component

Posted by mriem on November 12, 2013 at 2:43 PM PST

Note this blog is obsolete, see for the current blog

Creating and using a composite component is very straightforward.

1. Creating the composite component
2. Using the composite component

Creating the composite component

<?xml version='1.0' encoding='UTF-8' ?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">

<html xmlns=""
            This is coming from a composite component! Hurray :)

Using the composite component

<!DOCTYPE html>

<html xmlns=""
        <title>Composite component</title>
        <h2>Composite component</h2>

Note the code for this sample is available as part of the Glassfish samples (see the subversion repository at

And that is it.


Related Topics >>