'How can I include code in a scaffolding view template in Grails 5?

I need to import one of my classes in one of my scaffolding views, this used to work in Grails 2 but now appears broken under 5.

I've tried both the GSP and JSP way of importing and both result with the same exception.

The error is as follows..

Message
Request processing failed; nested exception is groovy.lang.GroovyRuntimeException: Failed to parse template script (your template may contain an error or be trying to use expressions not currently supported): startup failed: GStringTemplateScript3.groovy: 3: Unexpected input: '@ page import' @ line 3, column 13. """; @ page import="tst.Customer" ; ^ 1 error
Caused by
Failed to parse template script (your template may contain an error or be trying to use expressions not currently supported): startup failed: GStringTemplateScript3.groovy: 3: Unexpected input: '@ page import' @ line 3, column 13. """; @ page import="tst.Customer" ; ^ 1 error

Thank you,



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source