• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

getAttributeScope(String name)

 
muthu moorthy
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there the getAttributeScope(String name) method in PageContext?

there is a qtn, in HF (Page- 565)

Which are valid method calls on a PageContext object ?
Answers:
B. getAttribute("key")
C. findAttribute("key")
E. getAttributeScope("key")
G. getAttribute("key", PageContext.SESSION_SCOPE)
 
Renu Radhika
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think E should be getAttributesScope
 
VijayKumar Sivagnanam
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

There is a method getAttributesScope(String name) which returns the scope of the attribute.
 
Gowher Naik
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
int getAttributesScope("myAtt");
Get the scope where a given attribute is defined.

Also
Enumeration getAttributeNamesInScope(int scope)
Enumerate all the attributes in a given scope.
 
Renu Radhika
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But then what is the purpose of findAttribute method,I guess that also will do the same thing??
 
D.R.Vinayak
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Renu Radhika:
But then what is the purpose of findAttribute method,I guess that also will do the same thing??



getAttribute method with only string argument returns object associated with the string in pageScope only ,While findAttribute(String) method will search in page,request, session ,application in this order
it will return one if it finds the object associated else return null.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic