0
我使用的是Spring MVC模型屬性方法。打開屏幕時,我必須閱讀JSON字符串並創建一個地圖。在下拉列表中顯示地圖。我可以看到HTML源代碼中的值,但看不到屏幕中的下拉菜單。春天mvc窗體:選擇選項不顯示在屏幕上但在HTML源代碼中
@RequestMapping("/xxx")
public ModelAndView saws(Map<String, Object> model1) throws IOException {
ModelAndView model = new ModelAndView("xxx");
model.addObject("message", this.welcome);
Map<String, String> offers = engine.getOffers();
model.addObject("offers", offers);//map of offers
model.addObject("inputs", new inputs());
return model;
}
JSP
<form:form action="getoffers" method="get" modelAttribute="inputs">
<body>
<table align="center">
<tr class="blank_row">
<td colspan="2"></td>
</tr>
<tr class="blank_row">
<td colspan="2"></td>
</tr>
<tr align="center">
<th span
style="color: red; font-weight: bold; word-wrap: break-word;"
align="center">Select the service to view current offers</th>
</tr>
<tr>
<td><form:select path="offers">
<form:options items="${offers}" />
</form:select></td>
</tr>
</table>
並且在屏幕我沒有看到下降down.when我檢查的源代碼我看到這一點。請看到的圖片
spot on.that worked.Sure I'll into into thymeleaf – Shiv
@Shiv不用客氣。這也是因爲你的問題有足夠的細節。 –
感謝您的慷慨評論 – Shiv