I would like to use the Groovy tag in the Grails controller in the following:
trait ColumnSelectionController { def selectColumns() { //Do something here } } class MyController implements ColumnSelectionController { def index() { //Calculate list model } }
When I run this in Grails, the "selectColumns" action is not displayed, and I get a 404 response from Grails. I suspect that I need to do something with this attribute, so that the methods defined inside it are recognized as actions in the implementation class. Does anyone know what this could be?
EDIT 1:
Additional information: the attribute is defined in src / groovy, and not in grails-app / controller, therefore it is not defined as Artefact.
EDIT 2:
Also, if I change the trait in the class, mark it with the @Artefact annotation and change MyController to extend this class, everything will work as expected. Attempting to use the @Artefact annotation on the grounds of doing nothing (no big surprise).
source share