This week's book giveaway is in the Java 9 forum.
We're giving away four copies of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications and have Sander Mak & Paul Bakker on-line!
See this thread for details.
Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

PageContext.removeAttribute() doubt???  RSS feed

 
Amitkumar Dhama
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI all can anyone tell methe result of


PageContext.removeAttribute("amit")

If Attribute "amit" is available in all the scopes will it be removed from all the scopes, or only form the page scope....???

Thanking in advance.....
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Read the docs, there is no other better substitute.

Doc says:
removeAttribute() removes the object reference associated with the specified name in the given scope. Does nothing if there is no such object.

Thanks.
 
Amitkumar Dhama
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what if the scope is not specified???
 
Sai Patnala
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
removeAttribute on pageContext is overloaded, method that takes scope only removes from the specified scope, does nothing if there is no such object.

If scope is not specified, meaning using the removeAttribte(String name) mehtod, it removes the object reference associated with the given name from all scopes. Does nothing if there is no such object.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!