title: <h:outputScript> target problem when using templates
body: <p>I have a question about integrating jquery library with JSF 2.0 </p>
  
  <p>when using <code>&lt;h:outputScript library="/common/js" name="jquery-1.5.1.min.js"  target="head" /&gt;</code> , i should include <code>&lt;h:head&gt;</code> tag also in my xhtml file. so script is rendered at head.</p>
  
  <p>but i have a template.xhtml that contains <code>&lt;h:head&gt;,&lt;h:body&gt;</code> parts.  How can i make <code>target="head" /&gt;</code> for my page that derives from this template <code>ui:composition="template.xhtml"</code> ?</p>
  
  <p><code>target=form&gt;</code> didn't work either.</p>
  
  <p>my template:</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:p="http://primefaces.prime.com.tr/ui"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"&gt;
  
  &lt;h:head&gt;
      &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt;
      &lt;title&gt;&lt;h:outputText value="#{msg['label.titlemsg']}" /&gt;&lt;/title&gt;
      &lt;h:outputStylesheet library="css" name="style.css"  target="head"/&gt;
  &lt;/h:head&gt;
  
  &lt;h:body&gt;
  &lt;f:view locale="#{localeBean.locale}"&gt;
  
  &lt;div id="outer"&gt;
  
    &lt;div id="container"&gt; 
      &lt;div id="inner"&gt; 
  
        &lt;div class="float"&gt;
          &lt;div class="main"&gt; 
            &lt;!-- --&gt;
            &lt;div id="icerik"&gt; 
  
                &lt;ui:insert name="icerik"&gt;
  
  
  
        &lt;/ui:insert&gt;
      &lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
  
       &lt;div id="langbar" align="center"&gt;
  
  
      &lt;/div&gt;
  
  &lt;/f:view&gt;
  &lt;/h:body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>so i have "icerik".</p>
  
  <p>in my file:</p>
  
  <pre><code>&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:p="http://primefaces.prime.com.tr/ui"  
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"&gt;
  
  &lt;ui:composition template="/Template.xhtml"&gt;
  
      &lt;ui:define name="icerik"&gt;
  
      &lt;h:outputScript library="/common/js" name="jquery-1.5.1.min.js"  target="head" /&gt;
  &lt;h:outputScript library="/common/js" name="jquery.validate.js" target="head" /&gt; 
  
  
      &lt;/ui:define&gt;
  
  &lt;/ui:composition&gt;
  &lt;/html&gt;
  </code></pre>