A few days ago while trying an ajaxed request inside my page, using a4j to a rule defined URL using url rewrite api, I kept having this exception javax.faces.application.ViewExpiredException.
In my urlrewrite.xml I have the next rule:

<rule>
        <from>/add_registry</from>
        <to>/folder/add/add_registry.jsf</to>
</rule>

After some debugging, I found out that for some reason the post back request of JSF ajaxed request was coming as /folder/add/add_registry.jsf.jsf with the double .jsf it couldn’t be recognized and the view was lost, leading to the ViewExpiredException.
Adding the next <outbound-rule> under my previous <role> solved the problem.

<outbound-rule>
        <from>/folder/add/add_registry.jsf</from>
        <to>/add_registry</to>
</outbound-rule>

Related Posts:
Friendly URLs in JSF with Glassfish