import-bot (20211) [Avatar] Offline
#1
[Originally posted by saravanan]

Hi

I have a HashMap in session scope. I have added few entries in that HashMap
something like the following :

HashMap map = new HashMap();
map.put("name", "saravanan");
map.put("age", "20");
session.setAttribute("map", map);

In a jsp file, I want to print the value of name attribute (saravanan) by
removing it.

<%= ((Map)session.getAttribute("map")).remove("name") %>

How do I achieve the above expression in JSTL EL ?

TIA,
saravanan
import-bot (20211) [Avatar] Offline
#2
Re: Removing an entry in Map using JSTL EL
[Originally posted by bsiggelkow]

I don't think you can do acquire the value and remove in one statement using
EL. You can do this in two statements doing something like:

<%-- prints the value --%>
<c:out value="${sessionScope.map.name}"/>

<%-- remove the value from the map --%>
<c:set target="${sessionScope.map}" property="name" value="${null}"/>
573548 (1) [Avatar] Offline
#3
I want to know, Does Google Maps use data?