JSP Automatic Redirect After Session Expire/Timeout


 Steps :

1.Create index.jsp and write below code

================================================

<html>
    <head>
        <META HTTP-EQUIV="refresh" CONTENT="<%= session.getMaxInactiveInterval() %>; URL=error.jsp" />
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
   
    </body>
</html>


==================================================

2.create error.jsp
==================================================

3. in web.xml write below entry of session in minit

 <session-config>
        <session-timeout>
            1
        </session-timeout>
    </session-config>

==================================================

4.run index.jsp and wait for 1 minit , after one minit automatically error page display.
================================================


Comments

Popular posts from this blog

Filter In Javafx

Kotlin with StandAlone Complier