• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

c:remove

 
Vineela Devi
Ranch Hand
Posts: 191
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

If we dont specify any scope for <c:remove> will it search for the attribute in all the four scopes and then remove the one tht it encounters first or will it remove the attribute from all the scopes?(If the attribute with the same name exists in more than one scope).

Thanks in Advance
Vineela
 
Vishnu Prakash
Ranch Hand
Posts: 1026
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From JSTL 1.1 Spec


The <c:remove> action removes a scoped variable.
If attribute scope is not specified, the scoped variable is removed according to the semantics of PageContext.removeAttribute(varName). If attribute scope is specified, the scoped variable is removed according to the semantics of PageContext.removeAttribute(varName, scope).


From JSP 2.0 API


removeAttribute

public abstract void removeAttribute(String name)

Remove the object reference associated with the given name from all scopes. Does nothing if there is no such object.

removeAttribute

public abstract void removeAttribute(String name, int scope)

Remove the object reference associated with the specified name in the given scope. Does nothing if there is no such object.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic