• 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:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

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!