0
我需要獲取數據庫搜索的結果以便在gsp頁面上打印出來。目前,我有這個Grails從數據庫中獲取結果
<h1>Invoices</h1>
<g:each in="${dueInvoices}" var="di">
<li>${di}</li>
</g:each>
所有我回來時,我加載頁面
發票invoicetest.Invoices
我也嘗試命名HTML表內的數據庫中的每個列,仍然只得到同樣的事情,回來
我的Groovy代碼,使這項工作是
def dueInvoices(){
def today = new Date()
def invoices = Invoices.findAllByDueDateLessThan(today + 6)
render(view: "dueInvoices", model: [dueInvoices : Invoices ])
此代碼是用來尋找,在未來6天