title: How to redirect to Login page when Session is expired in Java web application?
body: <p>I'm running a web application in JBoss AS 5. I also have a servlet filter which intercepts all the requests to the server. Now, I want to redirect the users to the login page, if the session has expired. I need to do this 'isSessionExpired()' check in the filter and need to redirect the user accordingly. How do I do it? I'm setting my session time limit in web.xml, as below:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;session-config&gt;
      &lt;session-timeout&gt;15&lt;/session-timeout&gt;
  &lt;/session-config&gt;
  </code></pre>