Pergunta

I'm not sure how to implement this and I'm quite new to Wicket, but the behavior I'm trying to aim for is; when a session timeout occurs, the User is redirected to the login page to relog, when he relogs, he is then redirected to the page he was viewing before.

Any help is appreciated.

Foi útil?

Solução

The functionality you want only works when the server can identify which page you want to act on. So only stateless form submissions, and bookmarkable URLs will do this. Wicket does this out of the box, but only in the stateless/bookmarkable variations.

Wicket stores the page information (sort of) in the session. When the session has expired this information is no longer available. Then only requests that are not relative to the session/require information that used to be in the session will have the desired effect.

Outras dicas

Have you tried the following code in your WebApplication.init() method?

IApplicationSettings asSettings = getApplicationSettings();
asSettings.setPageExpiredErrorPage(PageErrorSessionExpired.class);

Substitute your own WebPage class for my PageErrorSessionExpired here.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top