title: includeViewParams=true converts null model value to empty string in query string
body: <p>Given a <code>&lt;p:selectOneMenu&gt;</code> as follows.</p>
  
  <pre><code>&lt;f:metadata&gt;
      &lt;f:viewParam name="id" value="#{testManagedBean.id}" converter="javax.faces.Long"/&gt;
  &lt;/f:metadata&gt;
  
  &lt;p:selectOneMenu value="#{localeBean.language}" onchange="changeLanguage();"&gt;
      &lt;f:selectItem itemValue="en" itemLabel="English" /&gt;
      &lt;f:selectItem itemValue="hi" itemLabel="Hindi" /&gt;
  &lt;/p:selectOneMenu&gt;
  
  &lt;p:remoteCommand action="#{testManagedBean.submitAction}"
                   name="changeLanguage"
                   process="@this"
                   update="@none"/&gt;
  </code></pre>
  
  <p>The corresponding managed bean :</p>
  
  <pre><code>@ManagedBean
  @RequestScoped
  public final class TestManagedBean {
  
      private Long id; //Getter and setter.
  
      public TestManagedBean() {}
  
      public String submitAction() {
          return FacesContext.getCurrentInstance().getViewRoot().getViewId() + "?faces-redirect=true&amp;includeViewParams=true";
      }
  }
  </code></pre>
  
  <p>The parameter as indicated by <code>&lt;f:viewParam&gt;</code> is optional. A page, for example is accessed using a URL as follows.</p>
  
  <p><code>https://localhost:8181/Project-war/private_resources/Test.jsf</code></p>
  
  <p>Since <code>id</code> is an optional parameter, an empty parameter is attached to the URL (when a language is changed from <code>&lt;p:selectOneMenu&gt;</code>), in case it is not supplied as follows.</p>
  
  <p><code>https://localhost:8181/Project-war/private_resources/Test.jsf?id=</code></p>
  
  <p>This should not happen. An empty parameter should not be appended, if it is not supplied and the URL should look like the first one.</p>
  
  <p>Is there a way to prevent an empty parameter from being appended to the URL, when it is not passed?</p>
  
  <hr>
  
  <p><strong>This is only associated with the converter as specified with <code>&lt;f:viewParam&gt;</code> - <code>javax.faces.Long</code>.</strong></p>
  
  <p>If this converter is removed then, parameters are not appended to the URL, in case no parameters are supplied.</p>
  
  <p>Although specifying a converter as demonstrated here is completely unnecessary, I have converters as shown below to convert an <code>id</code> passed though the URL as a query-string parameter to a JPA entity.</p>
  
  <pre><code>@ManagedBean
  @RequestScoped
  public final class ZoneConverter implements Converter {
  
      @EJB
      private final SharableBeanLocal sharableService = null;
  
      @Override
      public Object getAsObject(FacesContext context, UIComponent component, String value) {
          try {
              long parsedValue = Long.parseLong(value);
  
              if (parsedValue &lt;= 0) {
                  throw new ConverterException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Message Summary", "Message"));
              }
  
              ZoneTable entity = sharableService.findZoneById(parsedValue);
              if (entity == null) {
                  throw new ConverterException(new FacesMessage(FacesMessage.SEVERITY_WARN, "Message Summary", "Message"));
              }
  
              return entity;
          } catch (NumberFormatException e) {
              throw new ConverterException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Message Summary", "Message"), e);
          }
      }
  
      @Override
      public String getAsString(FacesContext context, UIComponent component, Object value) {
          return value instanceof ZoneTable ? ((ZoneTable) value).getZoneId().toString() : "";
      }
  }
  </code></pre>
  
  <p>This converter is now required to be specified explicitly with <code>&lt;f:viewParam&gt;</code> as follows.</p>
  
  <pre><code>&lt;f:viewParam name="id" 
               value="#{testManagedBean.id}"
               converter="#{zoneConverter}"
               rendered="#{not empty param.id}"/&gt;
  </code></pre>
  
  <p>And the associated managed bean needs to be changed as follows.</p>
  
  <pre><code>@ManagedBean
  @RequestScoped
  public final class TestManagedBean {
  
      private ZoneTable id;  //Getter and setter.
  
      public TestManagedBean() {}
  
      public String submitAction() {
          return FacesContext.getCurrentInstance().getViewRoot().getViewId() + "?faces-redirect=true&amp;includeViewParams=true";
      }
  }
  </code></pre>