Programmatically means calling setMaxInactiveInterval() from your servlet. (=programmatically setting the seesion timeout) setMaxInactiveInterval(0) will invalidate the session immediately, as stated in your book.
The mock question is about session-timeout in web.xml (=declaratively setting the session timeout) The session will never be invalidated if it is set to 0.
This is a common pitfall at the exam, be careful. [ May 15, 2006: Message edited by: Satou kurinosuke ]
public void setMaxInactiveInterval(int interval) Specifies the time, in seconds, between client requests before the servlet container will invalidate this session. A negative time indicates the session should never timeout.
Of course, a zero time indicates that 0 seconds should be taken before invalidating - i.e. invalidating immediately.
Charles Lyons (SCJP 1.4, April 2003; SCJP 5, Dec 2006; SCWCD 1.4b, April 2004)
Author of OCEJWCD Study Companion for Oracle Exam 1Z0-899 (ISBN 0955160340 / AmazonAmazon UK )
posted 14 years ago
Hi ranchers thanks for the help. I am clear about the difference after reading your posts.
SCJP 1.4, SCWCD 1.4
snakes are really good at eating slugs. And you wouldn't think it, but so are tiny ads: