javax.faces.application.ViewExpiredException

Reading Time: < 1 minute

I have come to use two solutions to prevent this exception. First of all I implement my managed bean clases to Serializable interface and add the below line into web.xml

    <!-- This line is to prevent ViewExpiredException -->
    <context-param>
   <param-name>com.sun.faces.enableRestoreView11Compatibility</param-name>
   <param-value>true</param-value>
</context-param>