Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Please help me?

 
XINGKANG WANG
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!
 
kapil munjal
Ranch Hand
Posts: 298
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
b) pageContext...
 
Rodrigo Dinis
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.
 
Paul Bourdeaux
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 ]
 
Vivek Mongolu
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
 
trivikram Kumar
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