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:[EMAIL PROTECTED]
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" <[EMAIL PROTECTED]>:

> 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:[EMAIL PROTECTED]
> Sent: Monday, August 11, 2003 12:21 PM
> To: Tag Libraries Users List; [EMAIL PROTECTED]
> Subject: Re: Removing a value from a map present in Session
> 
> 
> With JSTL:
> 
> <c:set target="${sessionScope.map}" property="name" value="${null}"/>
> 
> Quoting shanmugampl <[EMAIL PROTECTED]>:
> 
> > 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:[EMAIL PROTECTED]>
> D.O.Tech       <http://www.dotech.com/>

-- 
Kris Schneider <mailto:[EMAIL PROTECTED]>
D.O.Tech       <http://www.dotech.com/>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to