次のコントローラーからのコード スニペットでは、springSecurityService.currentUser にアクセスしようとすると、null ポインター例外が発生します。def springSecurityService がサービスを自動的に注入することを期待していますが、何が欠けていますか?
@Transactional(readOnly = true)
@Secured('ROLE_USER')
class TaskController {
static allowedMethods = [save: "POST", update: "PUT", delete: "DELETE"]
def index(Integer max) {
params.max = Math.min(max ?: 10, 100)
def springSecurityService
def user = springSecurityService.currentUser