0

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

<%@ 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参数。

4

1 回答 1

0

You have to enable it in your tag definition file (*.tld):

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

于 2013-06-10T18:30:45.523 回答