This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes about implicit objects Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "about implicit objects" Watch "about implicit objects" New topic

about implicit objects

air lulu
Ranch Hand

Joined: Jan 11, 2005
Posts: 42
Which of the following implicit objects can you use to store attributes that need
to be accessed from all the sessions of a web application? (Select two)
a application
b session
c request
d page
e pageContext

what is the answer?
i think the answer is a,d,e. but the question told that just two.
whick answer i chosse is wrong?
kapil munjal
Ranch Hand

Joined: May 11, 2004
Posts: 298
a is correct as it is accessible from everywhere.

d is correct as these attributes will be available to all the sessions.

e is incorrect as there is no such scope.

Kapil Munjal
SCJP 1.4, SCWCD 1.4
air lulu
Ranch Hand

Joined: Jan 11, 2005
Posts: 42
the question is asking "implicit objects ",not scope.
pageContext is implicit objects.
kapil munjal
Ranch Hand

Joined: May 11, 2004
Posts: 298
Yes, I was wrong on that...
then the answer would be a and e.

see this link

Well, if this time I am wrong then please tell me how we can use page implicit object to access the attributes.
air lulu
Ranch Hand

Joined: Jan 11, 2005
Posts: 42
how pageContext store attributes that need
to be "accessed from all the sessions" of a web application?
shiva viswanathan
Ranch Hand

Joined: Aug 12, 2004
Posts: 152
I think pagerContext is right because using pageContext you
can store attributes in the application scope indirectly

hence even pageContext is a valid answer
Sumeet Raheja

Joined: Dec 01, 2004
Posts: 16
Yes that Right ..Correct Answer is application and pageContext are only implicit object where one can store attribute , which will be availabe from any part of Application
Edmund Yong
Ranch Hand

Joined: Nov 16, 2003
Posts: 164
If the web application is distributed on two JVMs, then there will be two different servlet context objects, one on each JVM. Attributes that are set on one servlet context in one JVM may not be propagated to the servlet context in the other JVM. So how can answer (a) be correct?

SCJP 1.2, SCWCD 1.4
It is sorta covered in the JavaRanch Style Guide.
subject: about implicit objects
It's not a secret anymore!