سؤال

i have a map Map<String, String> flags; the values of this map are the names of flags' images. flags={fr=Flag_fr.jpg, usa=Flag_usa.jpg...}. Now i want to diplay the list of flags in my web page using the values ofmy map.

my page jsp looks as below:

 <s:iterator value="flags" > 
 <tr>
 <td> 
 <input type="image" src="%{value}">
 </td>
 </tr> 
 </s:iterator>

but the button images are not displayed however when i put the picture is well displayed.

هل كانت مفيدة؟

المحلول

I don't understand what do you mean by "when i put the picture is well displayed" but you can try:

<input type="image" src='<s:property value="value"/>' value='<s:property value="key" />' />

نصائح أخرى

We can do as below also

<input type="image" src='${value}' value='${key}' />
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top