Note this blog is obsolete, see for the current blog Ever wondered how you would use a composite component within a composite component? Or is it not possible? It most certainly is possible, so lets see how!   First we define level 2 (the deepest nesting) <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html> <html xmlns="" xmlns:h="" xmlns:cc=""> <head> <title></title> </head> <body> <cc:interface></cc:interface> <cc:implementation> This is coming from a nested composite component! Hurray :) </cc:implementation> </body> </html> Then we define level 1 (as you normally would, but now you will use a composite component within this composite component)<!DOCTYPE html> <html xmlns="" xmlns:cc="" xmlns:mypanel=""> <head> <title></title> </head> <body> <cc:interface></cc:interface> <cc:implementation> <mypanel:mypanel/> </cc:implementation> </body> </html> And then the page where we use the nested composite component <!DOCTYPE html> <html xmlns="" xmlns:h="" xmlns:mypanel=""> <h:head> <title>Composite component</title> </h:head> <h:body> <h2>Composite component</h2> <mypanel:nested/> </h:body> </html> Note the code for this sample is available as part of the Glassfish samples (see the subversion repository at And that is it. Enjoy!