领域
class Example {
String title
Date releaseDate
String author
Boolean paperback
static constraints = {
}
}
控制器
class ExampleController {
def scaffold = true
def search = {
exampleInstance = Example.findAllByTitleIlike("${params.q}%",[max:10, offset:0, sort:"title", order:"asc"])
redirect(action: "list",params)
return
}
def list = {
params.max = Math.min(params.max ? params.int('max') : 10, 100)
[exampleInstanceList: Example.list(params),
exampleInstanceTotal: Example.count()]
}
}
看法
<div id="search">
<g:form url='[controller: "example", action: "search"]' id="search" name="search" method="get">
<g:textField name="q" value="${params.q}" />
<input type="submit" value="Find" />
</g:form>
</div>
请帮助我是如何
Error URI /test3/example/search Class groovy.lang.MissingPropertyException
Message No such property: exampleInstance for class: test3.ExampleController