java - 我无法在下拉列表中显示列表值,该列表值作为列表从我的 JSP 中的 java 类传递。如果我使用表,我的代码可以完美运行
问题描述
我从我的 JSP 中的 java 类传递列表,我想在下拉列表中显示列表值。在调试时,我检查了该列表是否包含所需的值,但未显示在我的 JSP 下拉列表中。虽然如果我以表格形式显示这些值就会出现。
请告诉我哪里出错了,我怎样才能让我的代码工作?
Java 代码:
// add the event list to the model
theModel.addAttribute("event", theEvents);
return "fundContributionCollectionListPage";
JSP 代码:
<select name="eventSelected">
<c:forEach var="tempEvents" items="${event}">
<option value="tempEvents.eventName">${tempEvents.eventName}</option>
</c:forEach>
</select>
解决方案
推荐阅读
- django - 具有多平台的 Django REST 框架
- python - kpl 播放列表类型的 Python 解析器
- php - php 搜索文本将行/s 附加到数据库中的表
- reactjs - 使用 Ubuntu 20 禁用 Raspberry Pi 的手指手势
- c++ - 将多维数组传递给函数时是否重要?
- javascript - 无法检查 .tiff 文件中的 Web 元素或无法在 .tiff 文件中协调页面
- php - 当我想以 desc 顺序显示记录时如何计算余额?
- ios - Swift 包管理器配置获取触发器
- c# - 如何使用asp.net c#在下拉列表中设置> =条件
- c# - 在两个模式之间抓取文本