Include « Facelets « JSF Q&A

1. Include non-Facelet content in a Facelet template

Is there a way to have the content of an html file inserted into a Facelet template? The Facelets tag will not work since it is only for including ...

2. Ways to include a dynamically generated facelet

In current project I need to create a panel that will contain an HTML content created by the user elsewhere in the application. This content can be easily inserted like this:

<h:outputText ...

3. Problem using include in Facelets

I have problems including a facelet template. I wanted to split some content up, so that I can reuse it somewhere else. So I changed this code:

<!DOCTYPE html>
<ui:composition xmlns=""

4. How to include another XHTML in XHTML using JSF 2.0 Facelets?

What is the most correct way to include another XHTML page in an XHTML page? I have been trying different ways, none of them are working.

5.  with dynamic src does not invoke setters on backingbean

I have a first.jsf in which I include second.xhtml in the following way:

<ui:include src="#{firstBean.srcForSecond}" />
This works fine and renders the contents of second.jsf. I included it using EL as the included ...

6. Trying to change src tag dynamically

I have main page that looks like this:

<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.or/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns=""
    <title>Facelet Title</title>

7. Avoid multiple DOCTYPE and html tags when using ui:include

we are using several ui:include tags in the "main" page. The page that is to be included looks like this:

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

8. Change dynamic part of an snippet that is included via JSF-2.0 templateing

I have a problem with the JSF-2.0 templating mechanism. I implement some snippet that are included to template file. But one of my snippet contains dynamic content. I do not get an ...