tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Siggelkow, Bill" <bill.siggel...@mirant.com>
Subject RE: Removing a value from a map present in Session
Date Mon, 11 Aug 2003 18:08:35 GMT
Ahh !! You're right!  I was just looking at the spec for <c:set> and it is clearly stated.

-----Original Message-----
From: Kris Schneider [mailto:kris@dotech.com]
Sent: Monday, August 11, 2003 12:51 PM
To: Tag Libraries Users List
Subject: RE: Removing a value from a map present in Session


Well, there is subtlety involved, but it's in how JSTL handles a Map versus a
JavaBean. In the case of a Map, if "value" evaluates to null, the entry is
removed from the Map. In the case of a JavaBean, the property is set to null.

Quoting "Siggelkow, Bill" <bill.siggelkow@mirant.com>:

> There is a subtle difference here -- using the <c:set ...> method I think it
> will actually set the Map value to null but the key will still be there. 
> Whereas doing the explicity Map.remove() will actually remove the map
> entry.
> 
> -----Original Message-----
> From: Kris Schneider [mailto:kris@dotech.com]
> Sent: Monday, August 11, 2003 12:21 PM
> To: Tag Libraries Users List; shanmugampl@india.adventnet.com
> Subject: Re: Removing a value from a map present in Session
> 
> 
> With JSTL:
> 
> <c:set target="${sessionScope.map}" property="name" value="${null}"/>
> 
> Quoting shanmugampl <shanmugampl@india.adventnet.com>:
> 
> > Hi,
> > 
> >     I have a map in session scope which contains an entry with key 
> > "name". I want to remove that entry from the map
> > 
> > <%= ((Map)session.getAttribute("map")).remove("name") %>
> > 
> > How do i achieve this in jstl el ?
> > 
> > Thanks
> > Shanmugam PL
> 
> -- 
> Kris Schneider <mailto:kris@dotech.com>
> D.O.Tech       <http://www.dotech.com/>

-- 
Kris Schneider <mailto:kris@dotech.com>
D.O.Tech       <http://www.dotech.com/>

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org

Mime
View raw message