• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

c:remove custom tag

 
Sophie Angela
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<c:remove var="s">cool</c:remove>

s is a session scoped attribute..
will this tag remove the session scoped attribute s?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"remove" is not supposed to have a body.

Let's asuume that you remove the body. If you don't specify the scope in the "remove" tag, the process will be the same as calling PageContext.removeAttribute.
So check the API for removeAttribute, and you'll get your answer
 
dennis du
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agree with Satou kurinosuke.

c:remove will remove attrbutes in any scope.
It will only call : JspContext.removeAttribute(String attribute);
 
Harshit Patel
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So suppose if the attribute "s" exists in multiple scopes, only the first one encountered would be removed, or all of them would be removed?
 
Micheal John
Ranch Hand
Posts: 344
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in this case with scope page will be removed..
the order is page > request > session > application
 
Tridib Samanta
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So suppose if the attribute "s" exists in multiple scopes, only the first one encountered would be removed, or all of them would be removed?


All of them will be removed.
Accrding to API doc:

Remove the object reference associated with the given name from all scopes.
 
Seenikkannan krishnasamy
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please refer this Topic Confusion about "scope" attribute -- JSTL Thread

Thanks,
Seenikkannan.K

[ March 20, 2007: Message edited by: Seenikkannan krishnasamy ]

[ March 20, 2007: Message edited by: Seenikkannan krishnasamy ]
[ March 20, 2007: Message edited by: Seenikkannan krishnasamy ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic