मैं एक नियंत्रकअगर Grails में एक जीएसपी में बयान
def index() {
childInstance = Child.get(params.id)
if(childInstance){
System.out.println("CHILD" + childInstance.firstname)
def messages = currentUserTimeline()
[profileMessages: messages,childInstance:childInstance]
} else {
def messages = currentUserTimeline()
[profileMessages: messages]
System.out.println("ALL")
}
}
भीतर एक सूचकांक विधि कॉल जीएसपी पेज में मैं
${childInstance.firstname}
कौन सा है, तो मैं एक childInstance पारित इस ठीक है, लेकिन अगर मैं मैं एक नल पॉइंटर की वजह से एक 500 नहीं मिलता है वहाँ एक रास्ता मैं एक एक जीएसपी में बयान तो मैं क्या कर सकते हैं अगर यह
if(childInstance){
${childInstance.firstname}
} else {
All
}