Im wondering if something like this is possbile:
abstract class AbstractController {
def list = {
//default list action
}
}
class MyController extends AbstractController {
def show = {
//show action
}
}
Where AbstractController is not visible on the web i.e /app/abstract/list is not accessible and where MyController has the actions list and show and is accessible on the web as /app/my/….
Anyone ever done anything like this?
Try putting
AbstractControllerintosrc/groovyfolder.Though, sharing functionality over Controllers might be not the best idea – it’s better to move it to POGO classes or services. This question covers this issue partially: How do you share common methods in different grails controllers?