我想在提供no时创建一个接受book属性的动态表.在上一页输入的书籍. 但我没有得到任何东西. 这是我的代码: tablec:forEach begin="1" end= "${ no }" step="1" varStatus="loopCounter"trtdinput type='text' na
          但我没有得到任何东西.
这是我的代码:
<table>
<c:forEach begin="1" end= "${ no }" step="1" varStatus="loopCounter">
<tr>
<td>
<input type='text' name="isbn" placeholder="ISBN">
</td>
<td>
<input type="text" name="Title" placeholder="Title">
</td>
<td>
<input type="text" name="Authors" placeholder="Author">
</td>
<td>
<input type="text" name="Version" placeholder="Version">
</td>
</tr>
</c:forEach>
</table> 
 ${no}是我想要输入的图书数量.
我是新来的.对不起,如果标题不清楚.请帮忙.
<table>
    <!-- here should go some titles... -->
    <tr>
        <th>ISBN</th>
        <th>Title</th>
        <th>Authors</th>
        <th>Version</th>
    </tr>
    <c:forEach begin="1" end= "${ no }" step="1" varStatus="loopCounter"
        value="${lstBooks}" var="book">
    <tr>
        <td>
            <c:out value="${book.isbn}" />
        </td>
        <td>
            <c:out value="${book.title}" />
        </td>
        <td>
            <c:out value="${book.authors}" />
        </td>
        <td>
            <c:out value="${book.version}" />
        </td>
    </tr>
    </c:forEach>
</table> 
 根据注释了解问题后,请确保${no}变量在request.getAttribute(“no”)处可用.您可以使用scriptlet(但这是一个bad idea)或仅使用< c:out value =“${no}”/>来测试它.
请注意,正如我所说,变量应该可以通过request.getAttribute访问,不要将它与request.getParameter混淆.
顺便说一句,你可以设置一个变量,如果你知道它的值是这样的:
<c:set var="no" value="10" />
然后您可以使用${no}访问它.
更多信息:JSTL Core Tag
