JGC
JGC

Reputation: 12997

Pages expire very quickly in Wicket

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

Upvotes: 4

Views: 4781

Answers (3)

chandrasekar
chandrasekar

Reputation: 1

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>

Upvotes: 0

Matt
Matt

Reputation: 1119

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);
    }
}

Upvotes: 3

jsight
jsight

Reputation: 28409

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.

Upvotes: 12

Related Questions