What's the reason of page expire in web server and how to change its behavior?

This message often confuse my user:
Sorry, this page has expired. Please go back.
Why is this happening and how to avoid it if possible?

This happens when you use the continuation-based web server, and it's a result of the expiry of the continuation. Since the continuation is stored in memory in the web server, and anyone could have saved the URL somewhere, it would just stay there forever if it didn't expire. You can read more about this, and configure the policy, here: 2 Stateful Servlets