This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes HFSJ Book mock exam question ? context attribute confussion ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "HFSJ Book mock exam question ? context attribute confussion ?" Watch "HFSJ Book mock exam question ? context attribute confussion ?" New topic
Author

HFSJ Book mock exam question ? context attribute confussion ?

Tuna Töre
Ranch Hand

Joined: Aug 17, 2008
Posts: 219

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 ?


blog: http://tunatore.wordpress.com
SCJP 6.0 + SCWCD 1.5
Shiaber Shaam
Ranch Hand

Joined: Jun 16, 2006
Posts: 252
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.


$Hi/\bEr
Tuna Töre
Ranch Hand

Joined: Aug 17, 2008
Posts: 219

So what you mean C is incorrect ? >>>Context attributes survive a session time-out.
Then it should be typo like that ?

What others think about this question ?
ankit kumar
Ranch Hand

Joined: Apr 28, 2008
Posts: 108
hi

According to me option C should be correct because these attributes will survive even after the session will expired .


Cleared SCJP 1.5 | Cleared SCWCD 5.0
SCDJWS 6 in progress.....
Tuna Töre
Ranch Hand

Joined: Aug 17, 2008
Posts: 219

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 ....


ankit kumar
Ranch Hand

Joined: Apr 28, 2008
Posts: 108
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 .

Poonam Agarwal
Ranch Hand

Joined: May 12, 2008
Posts: 323
this should be a Typo I guess. Because option C says that : Context Attribute survive a session timeout.. which is absolutly WRONG.

Anut , what i think that question is asking whether the context attribute will remain alive after the session expires ?


Anut , what is base of your thinking process. how would to determine that?? because option C is not asking whether the context attribute will remain alive after the session expires ?

christophe please verify this

Thanks


Thanks <br />Poonam Agarwal SCWCD 86%
Tuna Töre
Ranch Hand

Joined: Aug 17, 2008
Posts: 219

If the answer was like that I will think same as you....
C. Context attributes survive after a session time-out.
 
Consider Paul's rocket mass heater.
 
subject: HFSJ Book mock exam question ? context attribute confussion ?
 
Similar Threads
Session Attributes and ServletContext
Session Attributes question
Session Management chapter in HF's WCD book
HFSJ Chapter 6 - Mock exam Question 7
the importance of an argument....