Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

Please help me?  RSS feed

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have some trouble in a question.Could someone tell me the answer?
Which of the following class/interface has a method to locate the value of the named attribute stored in page/request/session/application scope of JSP?
A.ServletContext
B.pageContext
c.HttpServletRequest
d.HttpServeltResponse
e.HttpSession
f.none of all
which one? Why?

good good study,day day up!
 
Ranch Hand
Posts: 298
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
b) pageContext...
 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think the better answer is f.none of all, because dont exists a unique method that makes it: locate the value of the named attribute stored in page/request/session/application in just one class/interface.
 
Ranch Hand
Posts: 783
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, the correct answer is definately b) pageContext. It inherits the following method from JspContext:
[ May 10, 2005: Message edited by: Paul Bourdeaux ]
 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
PageContext has another method findAttribute() which searches for the named attribute starting with page,then request, then session and then application scope. Once it finds the attribute in any of the scopes, that value is returned and it stops right there.

So the answer is definitely PageContext
 
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Even I go for pageContext
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!