title: How to add different javascripts on a page when using ui:composition
body: <p>I am using a page with ui:composition use on it like this</p>
  
  <pre><code>&lt;?xml version='1.0' encoding='UTF-8' ?&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.prime.com.tr/ui" 
      xmlns:f="http://java.sun.com/jsf/core"&gt;
  
      &lt;h:head&gt;
  
          &lt;title&gt;&lt;/title&gt;
  
      &lt;/h:head&gt;
  
      &lt;h:body&gt;
  
          &lt;ui:composition template="./WEB-INF/templates/layout.xhtml"&gt;
  
              &lt;ui:define name="title"&gt;#{faqAddUpdate.actionState} FAQ&lt;/ui:define&gt;
              &lt;ui:define name="content"&gt;
  
                  &lt;h:form id="faqAddUpdateForm" style="border-color: #000000;width: 960px;position: absolute;left: 150px;" prependId="false"&gt;
                  ....
                  ....
  
                  &lt;/h:form&gt;
  
              &lt;/ui:define&gt;
  
          &lt;/ui:composition&gt;
  
      &lt;/h:body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>My layout.xhtml look like this</p>
  
  <pre><code>&lt;?xml version='1.0' encoding='UTF-8'?&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"&gt;
  
      &lt;h:head&gt;
  
          &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
  
          &lt;script type="textext/javascript" src="ckeditor/ckeditor.js" &gt;
              &lt;ui:insert name="script"&gt;&lt;/ui:insert&gt;
          &lt;/script&gt;
  
          &lt;title&gt;
              &lt;ui:insert name="title"&gt;Login&lt;/ui:insert&gt; 
          &lt;/title&gt;
  
      &lt;/h:head&gt;
      &lt;h:body&gt;
          &lt;div id="top"&gt;
              &lt;ui:insert name="top"&gt;
                  &lt;ui:include src="header.xhtml" id="header"/&gt;
              &lt;/ui:insert&gt;
          &lt;/div&gt;
          &lt;div&gt;
              &lt;div id="content"&gt;
                  &lt;ui:insert name="content"&gt;&lt;/ui:insert&gt;
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;div id="bottom" style="position: absolute;top: 675px;width: 100%" align="center"&gt;
              &lt;ui:insert name="bottom"&gt;
                  &lt;ui:include src="footer.xhtml" id="footer"/&gt;
              &lt;/ui:insert&gt;
          &lt;/div&gt;
      &lt;/h:body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>on my page i am using something like this</p>
  
  <pre><code>&lt;h:body&gt;
  
      &lt;ui:composition template="./WEB-INF/templates/layout.xhtml"&gt;
          &lt;ui:define name="script"&gt;&lt;/ui:define&gt;
          &lt;ui:define name="title"&gt;#{faqAddUpdate.actionState} FAQ&lt;/ui:define&gt;
          &lt;ui:define name="content"&gt;
          ....
         &lt;/ui:define&gt;
  
     &lt;/ui:composition&gt;
  </code></pre>
  
  <p>This add javascript tag in my page head section.Now i want to ask if i want to add another .js file on my page. The i will have to define another ui:insert name="script" in my layout.xhtml page like this?</p>
  
  <pre><code>&lt;script type="textext/javascript" src="js/1.js" &gt;
          &lt;ui:insert name="script"&gt;&lt;/ui:insert&gt;
  &lt;/script&gt;
  
  &lt;script type="textext/javascript" src="js/2.js" &gt;
          &lt;ui:insert name="script"&gt;&lt;/ui:insert&gt;
  &lt;/script&gt;
  </code></pre>
  
  <p>and so on. Or is there any trick that i define script tag in my layout.xhtml once and then on the basis of src attribute, i insert it on my ui:composition page?</p>
  
  <p>Thanks</p>