• 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
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

about implicit objects

 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
question:
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?
 
Ranch Hand
Posts: 298
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
air lulu
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
the question is asking "implicit objects ",not scope.
pageContext is implicit objects.
 
kapil munjal
Ranch Hand
Posts: 298
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, I was wrong on that...
then the answer would be a and e.

see this link

http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/JSPIntro7.html

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
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
how pageContext store attributes that need
to be "accessed from all the sessions" of a web application?
 
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think pagerContext is right because using pageContext you
can store attributes in the application scope indirectly
pageContext.setAttribute("userName","admin",PageContext.APPLICATION_SCOPE)

hence even pageContext is a valid answer
 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 242
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic