【发布时间】:2025-12-26 23:35:11
【问题描述】:
我有一个带有 JSTL 标记的 jsp 页面。该 jsp 页面包含 2 个不同的选项卡。如果用户单击第一个选项卡,则想要显示一个包含值列表的 tbody 表。效果很好。现在我想更改c:forEach 用户单击第二个选项卡时的项目。两个选项卡列表包含具有不同值的相同参数。所以我需要使用 javascript 更改 c:forEach 的项目。这可能吗 ?
谢谢你
在jsp中
<table id="dynamic-table">
<thead>
<tr>
<th>Sl.No.</th>
<th class="sorting_disabled">Loan Id</th>
<th class="sorting_disabled">Name</th>
</tr>
</thead>
<tbody>
<c:forEach var="mainlist" items="${S1List}" varStatus="status">
<tr>
<td class="center">${status.index + 1}</td>
<td>${mainlist.loanId}</td>
<td>${mainlist.name}</td>
</tr>
</tbody>
</table>
我想使用 javascript 将 items="${S1List}" 更改为 items="${S2List}"
Javascript
funcion changevalueWhenSecondTabclick(){
//I want the solution code here
}
【问题讨论】:
标签: javascript jsp jstl