C
Chris Riesbeck
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?
<c:set var="rates" value='${data["rates"]}'/>
<p>rates: ${rates}</p>
<p>jstl: ${rates.keys}</p>
<p>jsp: <%= ((edu.northwestern.ils.simulator.SimTable)
pageContext.findAttribute("rates")).getKeys() %></p>
Here's the generated HTML output:
<p>rates: {Bill=100.0, Fred=75.0, Jane=75.0, Mary=50.0, Sam=75.0,
Sarah=150.0}</p>
<p>jstl: </p>
<p>jsp: [Bill, Fred, Jane, Mary, Sam, Sarah]</p>
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?
<c:set var="rates" value='${data["rates"]}'/>
<p>rates: ${rates}</p>
<p>jstl: ${rates.keys}</p>
<p>jsp: <%= ((edu.northwestern.ils.simulator.SimTable)
pageContext.findAttribute("rates")).getKeys() %></p>
Here's the generated HTML output:
<p>rates: {Bill=100.0, Fred=75.0, Jane=75.0, Mary=50.0, Sam=75.0,
Sarah=150.0}</p>
<p>jstl: </p>
<p>jsp: [Bill, Fred, Jane, Mary, Sam, Sarah]</p>