You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Karina Wong <ka...@financialcontent.com> on 2004/03/17 02:19:58 UTC
help with access nested hash in jsp
Hi,
For my structs application I have a Hash Map of Hash Maps, the outer hash is
keyed by pagenumber and the inner hash is keyed by date. Sample data.
hash{1}={ {2004-03-14 =34}, {2004-03-13 =33}... }
hash{2}={ {2004-03-14 =33}, {2004-03-13 =23}... }
How do I access a specific value of the inner hash inside a jsp page? For
example if I want to display the count for page 2 on date 2004-03-13.
I can render the whole inner hash with :
<nested:iterate id="innermap" name="hash" >
<nested:write name="innerhash" property="value"/>
</nested:iterate>
I tried to render a specific value using :
<nested:iterate id="innermap" name="hash" >
<nested:write name="innerhash" property="value(2004-03-13)"/>
</nested:iterate>
but it did not render anything.
I've already wrapped the inner hash with a hasbean, which defines a
getValue(String key) method, but that still doesn't work.
Please help
Thanks
KK
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org