How can i read the session-timeout
from the web.xml file?
Tried
getServletContext().getAttribute(\"session-timeout\").toString();
Here's an oneliner.
int sessionTimeoutFromWebXml = Integer.parseInt(XPathFactory.newInstance().newXPath().compile("web-app/session-config/session-timeout").evaluate(DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(getServletContext().getResourceAsStream("/WEB-INF/web.xml"))));
;)
It should be
session.getMaxInactiveInterval();
It will return time in seconds.