• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

HFSJ Book mock exam question ? context attribute confussion ?

 
Ranch Hand
Posts: 220
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ?

 
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Tuna Töre
Ranch Hand
Posts: 220
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ?
 
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi

According to me option C should be correct because these attributes will survive even after the session will expired .
 
Tuna Töre
Ranch Hand
Posts: 220
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 .

 
Ranch Hand
Posts: 324
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Tuna Töre
Ranch Hand
Posts: 220
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If the answer was like that I will think same as you....
C. Context attributes survive after a session time-out.
 
There are 10 kinds of people in this world. Those that understand binary get this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic