How can you change the page displayed by Tapestry 4 when the user's session expires?
If you need to check if the user is logged in or something similar, you can set a property in your Visit object, and check for it in the validate(IRequestCycle cycle)
method of your pages. If there are several pages, create a superclass for all the pages you want to redirect when there's no user logged in, and implement the method in the superclass. Remember that whenever you call getVisit()
you get a new instance if there isn't any, so you need to set a property in your Visit object to see if the session is valid.
Ah, the old days, Tapestry 4...
I think there were different ways..
just name the page you want to display "StaleSession.html", or
put something in your app.application file.. like
<page name="StaleSession" specification-path="tapestry/page/StaleSession.page"/>
or
- put something in your hivemodule.xml, like
<contribution configuration-id="tapestry.InfrastructureOverrides">
<property name="staleSessionPageName" value="MyStaleSessionPage" />
</contribution>
hth