• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

c:remove custom tag

 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
reply
    Bookmark Topic Watch Topic
  • New Topic