I wrote a base class to quickly create my controllers and remove duplication. It provides some helper methods, default actions, and some metaprograms to make them easier to create.
One of these methods in the base class is as follows:
def dynamicList(Class clazz) { def model = new LinkedHashMap() model[getMapString(clazz) + "s"] = list(clazz) model[getMapString(clazz) + "sTotal"] = count(clazz) model }
The action that invokes it, also in the base class, is as follows:
def list = { dynamicList(clazz) }
Unfortunately, when I go to the list of actions in a controller subclass that inherits the base class when deploying my application, I get this exception:
groovy.lang.MissingMethodException: No signature of method: groovy.lang.MissingMethodException.dynamicList() is applicable for argument types: (java.lang.Class) values: [class project .user.User] at project.user.UserController$_closure1.doCall(UserController.groovy:18) at project.user.UserController$_closure1.doCall(UserController.groovy) at java.lang.Thread.run(Thread.java:619)
How can I put gravel over my head and just say that he is doing what I want him to do? My tests on the controller work very well, so Grails runtime is completely to blame: /
Ken
source share