gpt4 book ai didi

foreach - 根据 TLD,forEach 标签的属性值无效

转载 作者:行者123 更新时间:2023-12-05 04:14:52 31 4
gpt4 key购买 nike

我有这个代码

<c:forEach var="l" value="${logs}">
...
</c:forEach>

它说:

Attribute value invalid for tag forEach according to TLD

最佳答案

forEach标签不支持 value属性。 IE。 <c:forEach value>不被认可。真的,这基本上就是错误试图告诉你的。

如咨询the documentation of the forEach tag , 然后你会看到 value属性表中确实没有提到属性。仅列出以下属性:

  • items - Collection of items to iterate over.
  • begin - If items specified: Iteration begins at the item located at the specified index. First item of the collection has index 0. If items not specified: Iteration begins with index set at the value specified.
  • end - If items specified: Iteration ends at the item located at the specified index (inclusive). If items not specified: Iteration ends when index reaches the value specified.
  • step - Iteration will only process every step items of the collection, starting with the first one.
  • var - Name of the exported scoped variable for the current item of the iteration. This scoped variable has nested visibility. Its type depends on the object of the underlying collection.
  • varStatus - Name of the exported scoped variable for the status of the iteration. Object exported is of type javax.servlet.jsp.jstl.core.LoopTagStatus. This scoped variable has nested visibility.

猜猜你真正需要哪一个。如果您不确定,Java EE tutorial可能有帮助。

关于foreach - 根据 TLD,forEach 标签的属性值无效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34018266/

31 4 0