我有一个控制器和一个gsp。我继续尝试构建项目,但在我的gsp上收到问题。Grails自定义服务器页面(自定义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>
不允许我用“它”这样呢?还是有什么明显的我失踪了?
因为你是刚刚开始,我会建议开始www.grails.org – 2010-09-07 23:48:04
但你说得对。你不能用“它 - >”,但如果你省略'它 - >'我相信它会起作用 - 但它并不是真正的Groovy/Grails做法! – sbglasius 2010-09-08 09:54:28