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

doubt in pg 565 custom tag development- question no 14

 
harinath chakrapani
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
which are valid method calls on a page Context object?

its given
are correct what is the diffence?


also



what does this mean



 
Sandip Kaviman
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you see the method signature of the method your doubt will be clear.



This method takes name of the attribute as String and returns the scope in which attribute is defined.

Hope this helps.

Sandip
 
Ravi Singh
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you do pagecontext.getAttribute("key") it is equivalent to pagecontext.getAttribute("key",Pagecontext.PAGE_SCOPE)
It means that an attribute bound to page scope will be found.

When you do pagecontext.findAttribute("key") an attribute is searched from page scope to application scope and which ever is found first is returned

Bottom line :

In pagecontext.getAttribute("key",Pagecontext.PAGE_SCOPE) attribute is only searched in page scope

In pagecontext.findAttribute("key") attribute is searched in all 4 scopes
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic