title: Prevent component tree serialization for certain parts of application
body: <p>Is it possible to explicitly deny JSF from serializing some component trees? At the moment I am passing a non-serializable object to a <code>&lt;h:inputText&gt;</code>:</p>
  
  <pre><code>&lt;h:inputText value="#{nonSerializableBean.nonSerializableClassInstance}" /&gt;
  </code></pre>
  
  <p>What happens after a few clicks is that I get (during view restoration):</p>
  
  <pre><code>javax.faces.FacesException: Unexpected error restoring state for component
  with id configurationForm:j_idt292:j_idt302:field.  Cause:
  java.lang.IllegalStateException: java.lang.InstantiationException:
  my.namespace.NonSerializableClass
  </code></pre>
  
  <p>I think this occurs because JSF cannot restore the <code>nonSerializableClassInstance</code>:</p>
  
  <pre><code>Caused by: java.lang.IllegalStateException: java.lang.InstantiationException: com.foobar.utils.text.Period
  at javax.faces.component.StateHolderSaver.restore(StateHolderSaver.java:110)
  at javax.faces.component.ComponentStateHelper.restoreState(ComponentStateHelper.java:292)
  at javax.faces.component.UIComponentBase.restoreState(UIComponentBase.java:1444)
  at javax.faces.component.UIOutput.restoreState(UIOutput.java:255)
  at javax.faces.component.UIInput.restoreState(UIInput.java:1359)
  </code></pre>
  
  <p>A bonus question: Is it ok not to make backing beans Serializable? Should this then prevent serialization/deserialization of these?</p>
  
  <p><em>Some background:</em></p>
  
  <p>We have a bunch of 3rd party classes that we need to provide forms for in JSF. The problem is that we cannot directly use these classes on JSF pages, because they do not implement Serializable interface, and thus will/should fail if JSF runtime decides to serialize/deserialize the page and the component-tree. The classes are "closed" and we are not allowed to modify them.</p>
  
  <p>Running Mojarra 2.0.2.</p>