Taken from Head First SCWCD First Edition mock exam
Which about web attributes are true?
(Choose all that apply.)
A. No attributes are longer lived than session attributes.
B. In all scopes, attributes can be retrieved using a
getAttribute() method. C. Context attributes survive a session time-out. D. Only session and context attributes can be
retrieved in an enumeration.
E. Data stored in both request and session objects
is thread safe.
The correct answers are B-C
But I do not understand why C is correct ?
context attributes are application level attributes and hence its no way related to session. even if a session expires, the corresponsding session variables will be inaccessible but not the context alias application attributes. application attributes dont require a session at all.
Sorry but the option C never say that it lives after session time-out if it says like that then you are right ?
My understanding is that context attributes have a session timeout from the questiom ? Am I wrong may be I understand the question wrong ?
Correct me ....
Joined: Apr 28, 2008
Anut , what i think that question is asking whether the context attribute will remain alive after the session expires ?
because context attribute doesn't concern with any session . it concerns with the application .