Quantcast
Viewing latest article 9
Browse Latest Browse All 10

Spring security, DWR and session time out

In AJAX applications, using Spring security, handling session time out is a bit tricky. The problem is summarized here. Fortunately with DWR it is easy. DWR provides a way to handle errors, exceptions etc globally. Check  more on this here . As mentioned in the doc, you can use ‘textHtmlHandler’ to handle session time out. Here is the snippet,

dwr.engine.setTextHtmlHandler(function() {

//If the current page is secure, Spring security redirects you to login page
document.location.reload(true);
//Or you can set the document.location to your login page.
})

Image may be NSFW.
Clik here to view.
Image may be NSFW.
Clik here to view.

Viewing latest article 9
Browse Latest Browse All 10

Trending Articles