【问题标题】:Accepting variables in custom tags接受自定义标签中的变量
【发布时间】:2013-06-06 11:11:37
【问题描述】:

如何在自定义标签中传递变量?

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="/WEB-INF/lib/tags/customTag.tld" prefix="ct" %>
    <c:forEach var="i" begin="0" end="2">
        <tr>
            <td><c:out value="${i}" /></td>
            <td><ct:user par="1" num="${i}" /></td>
            <td><ct:user par="2" num="${i}" /></td>
        </tr>

    </c:forEach>

我无法将 ${i} 传递给 num 参数。

【问题讨论】:

    标签: jsp jsp-tags


    【解决方案1】:

    您必须在标签定义文件 (*.tld) 中启用它:

    见:What are <required> and <rtexprvalue> used for?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-01-03
      • 2014-09-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-12-27
      相关资源
      最近更新 更多