문제

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