I have a variable map in a database which is being returned and i want to display the details on a web page, the front end is struts2.
I tried this
<html:iterator value="fields" id="field">
<html:textfield name="#field.value" key="#field.value" label="#field.key"/>
</html:iterator>
obviously this didn’t work, how can i get the Key Name easily so i can have code like this
The idea is to display as follows
Name: [ ]
Random: [ ]
Something: [ ]
as textfields in a form…
How can i do this simply?
Well not sure how to do it in
<html:iterator>as never saw it in struts2 tag libor have not came across it.will use simple
<iteraor>tagassuming we have
listmapas mapinner iterator is context sensitive it will use the last value pushed onto the stack. The status attribute gives us a IteratorStatus object each iteration which is useful if we want to know the current iteration.