title: Unable to pass boolean in URL
body: <p>I have 2 pages, <code>inputForm.xhtml</code> and <code>outputPage.xhtml</code>.</p>
  
  <p>In <code>inputForm.xhtml</code>, there are 1 textfield and 1 checkbox. When user clicks submit button, the values are passed to <code>outputPage.xhtml</code> in URL.</p>
  
  <p>The value of textfield can be passed correctly. However, no matter the checkbox is checked or not, the parameter in URL is always false.</p>
  
  <p>e.g. <code>http://localhost:8080/jsf-web/outputPage.xhtml?c=false&amp;n=franz</code></p>
  
  <p>I am using myFaces 2.1.13. I really have no idea how to fix that. Thanks.</p>
  
  <p><code>inputForm.xhtml</code></p>
  
  <pre><code>&lt;html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"&gt;
  
  &lt;f:metadata&gt;
      &lt;f:viewParam name="n" value="#{inputFormBean.name}" /&gt;
      &lt;f:viewParam name="c" value="#{inputFormBean.nameUppercase}" /&gt;
  &lt;/f:metadata&gt;
  
  &lt;h:head&gt;
  &lt;/h:head&gt;
  &lt;h:body&gt;
      &lt;h:form&gt;
          &lt;p&gt;Name: &lt;h:inputText value="#{inputFormBean.name}" /&gt;&lt;/p&gt;
          &lt;p&gt;Name uppercase: &lt;h:selectBooleanCheckbox value="#{inputFormBean.nameUppercase}"/&gt;&lt;/p&gt;
          &lt;p&gt;&lt;h:commandButton action="output_page" value="Submit" /&gt;&lt;/p&gt;
      &lt;/h:form&gt;
  &lt;/h:body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><code>outputPage.xhtml</code></p>
  
  <pre><code>&lt;html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"&gt;
  
  &lt;f:metadata&gt;
      &lt;f:viewParam name="n" value="#{outputPageBean.name}" /&gt;
      &lt;f:viewParam name="c" value="#{outputPageBean.nameUppercase}" /&gt;
  &lt;/f:metadata&gt;
  
  &lt;h:head&gt;
  &lt;/h:head&gt;
  &lt;h:body&gt;
      &lt;h3&gt;Welcome #{outputPageBean.nameUppercase ? outputPageBean.name.toUpperCase() : outputPageBean.name}!!&lt;/h3&gt;
  &lt;/h:body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><code>faces-config.xml</code></p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;faces-config xmlns="http://java.sun.com/xml/ns/javaee" 
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd" 
      version="2.0"&gt;
  
      &lt;navigation-rule&gt;
          &lt;from-view-id&gt;*&lt;/from-view-id&gt;
          &lt;navigation-case&gt;
              &lt;from-outcome&gt;output_page&lt;/from-outcome&gt;
              &lt;to-view-id&gt;/outputPage.xhtml&lt;/to-view-id&gt;
              &lt;redirect include-view-params="true"/&gt;
          &lt;/navigation-case&gt;
      &lt;/navigation-rule&gt;
  &lt;/faces-config&gt;
  </code></pre>
  
  <p><code>InputFormBean.java</code></p>
  
  <pre><code>package com.franzwong.jsfweb;
  
  import javax.faces.bean.ManagedBean;
  import javax.faces.bean.RequestScoped;
  
  @ManagedBean
  @RequestScoped
  public class InputFormBean {
      private String name;
      private boolean nameUppercase;
  
      public String getName() {
          return name;
      }
      public void setName(String name) {
          this.name = name;
      }
      public boolean isNameUppercase() {
          return nameUppercase;
      }
      public void setNameUppercase(boolean nameUppercase) {
          this.nameUppercase = nameUppercase;
      }
  }
  </code></pre>
  
  <p><code>OutputPageBean.java</code></p>
  
  <pre><code>package com.franzwong.jsfweb;
  
  import javax.faces.bean.ManagedBean;
  import javax.faces.bean.RequestScoped;
  
  @ManagedBean
  @RequestScoped
  public class OutputPageBean {
      private String name;
      private boolean nameUppercase;
  
      public String getName() {
          return name;
      }
      public void setName(String name) {
          this.name = name;
      }
      public boolean isNameUppercase() {
          return nameUppercase;
      }
      public void setNameUppercase(boolean nameUppercase) {
          this.nameUppercase = nameUppercase;
      }
  }
  </code></pre>