• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

c:remove custom tag  RSS feed

 
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?
 
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
 
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);
 
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?
 
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
 
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.

 
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 ]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!