4

I have a Wicket application and my pages expire very quickly. Why is this, and what can I do about it?

3 Answers 3

12

I assume that by "My page is Expiring" you mean that the session is expiring? If so, you can increase the session-timeout in the web.xml of your project:

<session-config>
        <session-timeout>30</session-timeout>
</session-config>

The timeout is specified in minutes.

3

You can also do this programatically, by getting the HttpSession of the request and setting MaxInactiveInterval.

Integer timeoutInMinutes = 20;
Request request = RequestCycle.get().getRequest();
if( request instanceof WebRequest )
{
    WebRequest wr = (WebRequest)request;
    HttpSession session = wr.getHttpServletRequest().getSession();
    if( session != null ) {
        session.setMaxInactiveInterval(timeoutInMinutes*60);
    }
}
0

In web.xml, increase the session timeout from 30 minutes to 200 minutes, as shown below:

<session-config>
    <session-timeout>30</session-timeout>
</session-config>

should become

<session-config>
    <session-timeout>200</session-timeout>
</session-config>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.