title: Richfaces template header
body: <p>I'm using RichFaces 4.1 and I found out for my template as shown below:</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:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:a4j="http://richfaces.org/a4j"&gt;
  
  &lt;h:head&gt;
      &lt;title&gt;&lt;ui:define name="title"&gt;Application Title&lt;/ui:define&gt;&lt;/title&gt;
      &lt;meta http-equiv="content-type" content="text/xhtml; charset=UTF-8" /&gt;
  &lt;/h:head&gt;
  
  &lt;h:body&gt;
      &lt;ui:insert name="body"&gt;Default content&lt;/ui:insert&gt;
  &lt;/h:body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>It always add extra head info for me:</p>
  
  <pre><code>&lt;link type="text/css" rel="stylesheet" href="/org.richfaces.resources/javax.faces.resource/org.richfaces.staticResource/4.1.0.Final/PackedCompressed/DEFAULT/skinning.css" /&gt;&lt;script type="text/javascript" src="/javax.faces.resource/jsf.js.jsf?ln=javax.faces"&gt;&lt;/script&gt;&lt;script type="text/javascript" src="/org.richfaces.resources/javax.faces.resource/org.richfaces.staticResource/4.1.0.Final/PackedCompressed/packed/packed.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>If I take out this portion from template, those extra info will be disappear:</p>
  
  <pre><code>&lt;h:head&gt;
      &lt;title&gt;&lt;ui:define name="title"&gt;Application Title&lt;/ui:define&gt;&lt;/title&gt;
      &lt;meta http-equiv="content-type" content="text/xhtml; charset=UTF-8" /&gt;
  &lt;/h:head&gt;
  </code></pre>
  
  <p>With that extra info, the page renders better however if this page navigate to next page base on value return from form action (as defined in faces-config.xml), the component (e.g. a4j:commandButton ) will not work, need click twice to function.</p>
  
  <p>Is that a bug? If you go to richfaces showcase and open the source, the meta info for head are diff.  Any ideal why I get those extra meta info that seem buggy...  </p>
  
  <p>----  Some extra info ---
  Hi Brendan</p>
  
  <p>Thanks for the suggestion but not help...</p>
  
  <p>[Template]</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:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:a4j="http://richfaces.org/a4j"&gt;
  &lt;f:view contentType="text/html"&gt;
      &lt;h:head&gt;
          &lt;ui:insert name="head"&gt;&lt;/ui:insert&gt;
          &lt;!-- Mimic Internet Explorer 8 --&gt;
          &lt;meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" /&gt;
          &lt;meta http-equiv="content-type" content="text/xhtml; charset=UTF-8" /&gt;
          &lt;title&gt;&lt;ui:insert name="title"&gt;CEA&lt;/ui:insert&gt;&lt;/title&gt;
      &lt;/h:head&gt;    
  
      &lt;h:body&gt;
          &lt;div id="page"&gt;
              &lt;div id="header"&gt;
                  &lt;div class="right-controls"&gt;
                      &lt;ul class="top-links layout"&gt;
                          &lt;li&gt;&lt;a href="http://jboss.org/richfaces" target="_blank"&gt;Project Site&lt;/a&gt;
                          &lt;/li&gt;
                      &lt;/ul&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
  
              &lt;div id="page-content"&gt;             
                  &lt;ui:include src="/templates/includes/navigation.xhtml" /&gt;            
  
                  &lt;ui:insert name="body"&gt;
                          Body content missed
                  &lt;/ui:insert&gt;
                  &lt;div class="clear"&gt;&lt;/div&gt;
              &lt;/div&gt;
              &lt;div id="footer"&gt;
                  &lt;ui:insert name="footer"&gt;&lt;/ui:insert&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/h:body&gt;
  &lt;/f:view&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>[p.xhtml]</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;ui:composition xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:rich="http://richfaces.org/rich"
      template="/templates/template.xhtml"&gt;
      &lt;h:outputStylesheet&gt;
  .red {
      color: red;
  }
  .green {
      color: green;
  }
  &lt;/h:outputStylesheet&gt;
      &lt;ui:define name="body"&gt;
          &lt;h:form&gt;
              &lt;a4j:commandButton value="Store changes"
                  action="#{profileCreation.goNext}" /&gt;
          &lt;/h:form&gt;
      &lt;/ui:define&gt;
  &lt;/ui:composition&gt;
  </code></pre>
  
  <p>profileCreation.goNext only do one thing, return the success value:</p>
  
  <pre><code>public String goNext() {
    return IdmConst.IDM_CREATE_PROFILES_SUCCESS;
  }
  </code></pre>
  
  <p>[faces-config.xml]</p>
  
  <pre><code> &lt;navigation-rule&gt;
    &lt;display-name&gt;p.jsf&lt;/display-name&gt;
    &lt;from-view-id&gt;/public/idm/p.xhtml&lt;/from-view-id&gt;
    &lt;navigation-case&gt;
     &lt;from-outcome&gt;IDM_CREATE_PROFILES_SUCCESS&lt;/from-outcome&gt;
     &lt;to-view-id&gt;/jsf/idm/resetpwd.xhtml&lt;/to-view-id&gt;
    &lt;/navigation-case&gt;
   &lt;/navigation-rule&gt;
  </code></pre>
  
  <p>[resetpwd.xhtm]</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:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:rich="http://richfaces.org/rich"
      xmlns:a4j="http://richfaces.org/a4j"&gt; 
  
  &lt;ui:composition template="/templates/template.xhtml"&gt;
      &lt;ui:define name="head"&gt;
          &lt;style type="text/css"&gt;
  .leftColumn {
      width: 40%;
      vertical-align: top;
      text-align: left;
      padding: 15px;
      background: #00FFFF;
  } 
  .rightColumn {
      width: 60%;
      vertical-align: top;
      text-align: left;
      padding: 15px;
  }
  .red {
      color: red;
  }
  .green {
      color: green;
  }
  &lt;/style&gt;
      &lt;/ui:define&gt;
      &lt;ui:define name="title"&gt;Change / Rest Password&lt;/ui:define&gt;
      &lt;ui:define name="body"&gt;
      &lt;h:form id="resetPwdForm"&gt;    
          &lt;rich:graphValidator value="#{passwordValidationBean}" id="gv"&gt;
              &lt;rich:panel header="Change password" style="width:500px"&gt;
                  &lt;rich:messages for="gv"/&gt;
                  &lt;rich:messages globalOnly="true"/&gt;
                  &lt;h:panelGrid columns="3"&gt;
                      &lt;h:outputText value="Enter new password:" /&gt;
                      &lt;h:inputSecret value="#{passwordValidationBean.password}" id="pass" /&gt;
                      &lt;rich:message for="pass" /&gt;
                      &lt;h:outputText value="Confirm the new password:" /&gt;
                      &lt;h:inputSecret value="#{passwordValidationBean.confirm}" id="conf" /&gt;
                      &lt;rich:message for="conf" /&gt;
                  &lt;/h:panelGrid&gt;
                  &lt;a4j:commandButton value="Store changes"
                      action="#{passwordValidationBean.storeNewPassword}" /&gt;
              &lt;/rich:panel&gt;
          &lt;/rich:graphValidator&gt;        
      &lt;/h:form&gt;
      &lt;/ui:define&gt;
  &lt;/ui:composition&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>[passwordValidationBean]</p>
  
  <ul>
  <li>I use the sample from richfaces showcase (http://richfaces-showcase.appspot.com/richfaces/component-sample.jsf?demo=graphValidator&amp;skin=blueSky)</li>
  </ul>
  
  <p>As you can see as defined in faces-config, after user click the button on p.xhtml it will go to resetpwd.xhtml, if I have .. defined in template, then the button on resetpwd.xhtml will not work properly, I need click twice then will process the request.  Well, if I directly go to resetpwd.xhtml wthout go throgh p.xhtml, everything is working fine.</p>
  
  <p>So I suspect the problem cause by the .. defined in template., with this xml element, page source willd isplay extra header info:</p>
  
  <p></p>
  
  <p>Must be some bug in richfaces state management or the extra meta info included in head.  As mention if I directly go to resetpwd.xhtml, everything work fine (i.e. button on that page no need click twice to respond).   If navigate from p.xhtml to resetpwd.xhtml will work fine if take out the ... from tempalte file, but if I do so then the page will not render with skin.</p>