【问题标题】:how to iterate using jstl code如何使用 jstl 代码进行迭代
【发布时间】:2016-04-14 18:03:34
【问题描述】:

这是我的代码

<c:set var="radioCount" scope="session" value="${radiocount}"/>

我想创建一个行数不等于 radiocount 的表,因此尝试使用以下表达式但出现错误

<c:forEach   begin='1' end='radioCount'> 
            <tr>
            <td>
            <input style='width:500px' type='text' / >
            </td>
            </tr>
            </c:forEach>

【问题讨论】:

  • /jsp/showUserDefQuesPage.jsp(63,33) 如果我不使用引号,则应使用引号
  • else 对于输入字符串:"radioCount" java.lang.NumberFormatException.forInputString(Unknown Source)

标签: java jsp jstl jsp-tags


【解决方案1】:

尝试在您的 forEach 中使用括号并在您的代码中使用双引号 " 而不是 '

  <c:forEach   begin="1" end="${radioCount}"> 

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-02-09
    • 1970-01-01
    • 2013-02-19
    • 1970-01-01
    • 1970-01-01
    • 2011-01-08
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多