0
使用SQL Server 2000的簡單Grails 1.3.7應用程序。連接正常。創建新表確定。但是,嘗試訪問現有表時,請參閱下面的錯誤。約束條件:無法更改現有數據。問題:這個錯誤行[35]在哪個文件中?有什麼辦法允許空對象(例如,當對象爲空時,不要獲取屬性'id')?Grails使用遺留數據庫SQL服務器
Error 500:
Servlet: default
URI: /root0001/person/list
Exception Message: Cannot get property 'id' on null object
Caused by: Error evaluating expression [personInstance.id] on line [35]: Cannot get property 'id' on null object
Class: /person/list
At Line: [35]
Code Snippet:
Stack Trace
org.codehaus.groovy.grails.web.pages.exceptions.GroovyPagesException: Error evaluating expression [personInstance.id] on line [35]: Cannot get property 'id' on null object
at person_list$_run_closure2_closure27.doCall(person_list:67)
at person_list$_run_closure2.doCall(person_list:60)
at person_list$_run_closure2.doCall(person_list)
at person_list.run(person_list:76)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.NullPointerException: Cannot get property 'id' on null object
at person_list$_run_closure2_closure27_closure34.doCall(person_list:67)
... 5 more
你在哪裏檢索'personInstance'? – gotomanners