This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Doubt in setMaxInactiveInterval Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Doubt in setMaxInactiveInterval" Watch "Doubt in setMaxInactiveInterval" New topic

Doubt in setMaxInactiveInterval

raja ram
Ranch Hand

Joined: Mar 02, 2008
Posts: 169

Which of the following values used with setMaxInactiveInterval() will not cause the session to expunge.


My answers are 1,2,3 but correct answers given are 1,2 why not 3

Rufus Addis
Ranch Hand

Joined: Aug 21, 2008
Posts: 83
From the specs:

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.

So a zero value will cause the container to immediately expunge the session!

I agree. Here's the link:
subject: Doubt in setMaxInactiveInterval
It's not a secret anymore!