Grails 自定义服务器页面(自定义 gsp)
我有一个控制器和一个 gsp。我继续尝试构建该项目,但在我的 gsp 上收到问题。
它告诉我“当前作用域已经包含一个名为 it 的变量”
<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>
我不允许这样使用“it”吗?或者我遗漏了一些明显的东西?
I have a controller and a gsp. I go ahead and attempt to build the project but receive issues on my gsp.
It is telling me "The current scope already contains a variable of the name it"
<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>
Am I not allowed to use 'it' like that? Or is there something obvious that I'm missing?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
http://www.grails.org/Views+and+Layouts
http://www.grails.org/Views+and+Layouts