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

2 thoughts on “Spring security, DWR and session time out

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s