专辑的index.gsp中类groovy.lang.MissingPropertyException消息没有这样的属性:列表类:gtunes.Album可能的解决方案:ID,类,脏
这是给错误线路上无。 5,相同的代码我运行.HTML文件,然后它工作正常,但在index.jsp错误即将到来,我不明白为什么发生。
<div class="container-fluid"> <h3><p class="text-center">Album list</p></h3> <ul id="album" class="list-group"> <g:each var="album" in="${myvar}"> <button type="button" class="list-group-item" onClick="editalbum('${album.list}')"> <span class="badge">${album.title}</span> </button> </g:each> </ul> </div> </body> </html>
AlbumController.groovy 我已经DEF ABC这需要相册列表,并使它对索引页
package gtunes
import static org.springframework.http.HttpStatus.*
import grails.transaction.Transactional
@Transactional(readOnly = true)
class AlbumController {
static allowedMethods = [save: "POST", update: "PUT", delete: "DELETE"]
def index(Integer max) {
def abc = Album.list(max:10);
render(view:"index", model:[myvar:abc]);
//params.max = Math.min(max ?: 10, 100)
//respond Album.list(params), model:[albumInstanceCount: Album.count()]
}[Grails error][1]
https://drive.google.com/open?id=0B9gjSzsLSnClRFZVbWE1MWU0aDQ 这里是错误的图像
为什么你在这行有'$ {album.list}'?这个对象没有正确的列表作为错误状态。你想使用'list()'方法而不是属性? – droggo