我有一个控制器和一个 gsp。我继续尝试构建项目,但在我的 gsp 上收到问题。
它告诉我“当前范围已经包含一个名为它的变量”
<html>
<head>
<title>Book Collector</title>
<meta name="layout" content="main" />
</head>
<body>
<h1>Book Editor</h1>
<table>
<tr>
<th>Book Name</th>
<th>Author</th>
<th>Page Number</th>
<th>Vendor</th>
<th>Date Scanned</th>
<th>Date Read</th>
</tr>
<% bookList.each { it -> %>
<tr>
<td><%= it.bookName %></td> //this is where the error starts
<td><%= it.author %></td> //error (it)
<td><%= it.pageNumber %></td> //error (it)
<td><%= it.lastScan %></td> //error (it)
<td><%= it.lastRead %></td> //error (it)
<% } %>
</tr>
</table>
</body>
</html>
我不能那样使用“它”吗?或者有什么明显的我想念的吗?