Thursday, July 19, 2007

Hashmap examples used in jsp page?

Hi all,

Could anyone please point me to where i can find some examples using
hashmaps in a jsp with struts...
Instead of using a whole bunch of logic equal tags all the time, i need a
way to evaluate a collection, looking for a specific key value, then show or
hide the relevant input boxes on my jsp..
any help...please!!!???

See code sample below. The type in the iterate tag must be as shown, you
will then need to use a bean define to put your 'value' into the page
context and cast it to whatever type you have placed in your HashMap value.



<
logic:iterate id="list" name="gallery" property="artifacts"
type="java.util.Map.Entry">

<
bean:define id="artifact" name="list" property="value"
type="net.itwa.model.artifact.IArtifact"/>
<
bean:write name="artifact" property="description"/>
bean:write name="artifact" property="description">
logic:iterate>

ref

No comments: