Sunday, July 31, 2011

Getting HTTP session timeout max value in Java


If you want to know in Java the value of HTTP session timeout in ADF application. You can use the following code snippet.

        FacesContext facesCtx = FacesContext.getCurrentInstance();
        ExternalContext extCtx = facesCtx.getExternalContext();
        HttpSession session = (HttpSession)extCtx.getSession(false);
        int val = session.getMaxInactiveInterval();

Note that this value is coming from web.xml file you can see how to set this value by clicking here

Happy Jdeveloping,
Zeeshan Baig

No comments:

Post a Comment