Path: csiph.com!usenet.pasdenom.info!aioe.org!news.mixmin.net!news.musoftware.de!wum.musoftware.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Chris Riesbeck Newsgroups: comp.lang.java.programmer Subject: JSTL: getting a map's keys Date: Mon, 19 Mar 2012 13:15:52 -0500 Lines: 30 Message-ID: <9spbepF1baU1@mid.individual.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net lYOYzXT0AraLoJWtATvl+QobErd0iEB6wwAktsuDKsdw5pE+d6 Cancel-Lock: sha1:WnZY3nNUoknGNV12RhfiVKVYMZ4= User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 Xref: csiph.com comp.lang.java.programmer:13050 Can anyone help me figure out why the following is happening, or further experiments I can run? (I have workarounds but I'd like to know what I'm misunderstanding.) Given: - SimTable, a subclass of HashTable that defines getKeys() to call keyset() - a session variable "data" which is a HashTable with "rates" set to an instance of a SimTable Why does ${rates.keys} generate nothing in these lines of JSP?

rates: ${rates}

jstl: ${rates.keys}

jsp: <%= ((edu.northwestern.ils.simulator.SimTable) pageContext.findAttribute("rates")).getKeys() %>

Here's the generated HTML output:

rates: {Bill=100.0, Fred=75.0, Jane=75.0, Mary=50.0, Sam=75.0, Sarah=150.0}

jstl:

jsp: [Bill, Fred, Jane, Mary, Sam, Sarah]