|
|
I am attempting to customize the register controller in the spring-security-ui plugin and for some reason, the register method on the plugin controller is being executed instead of the register method on my controller.
I ran the "grails s2ui-override register testapp1" command to generate a register controller and gsp files in my application. I then added a "register" closure with the exact same signature. When I hit the register controller in the application (i.e. /register/register), my controller gets created but the register method on the plugin's register controller gets called instead of my controller.
I realize that the preferred Grails 2.0 way of controllers is with methods instead of closures but I don't want to change the plugin code. BTW, if I change from closures to methods, my register method gets called. I'm using Grails 2.0 RC1 and the latest spring-security-ui plugin.
So from the plugin's Register controller:
class RegisterController extends AbstractS2UiController {
static defaultAction = 'index'
def mailService
def saltSource
def index = {
[command: new RegisterCommand()]
}
def register(RegisterCommand command) {
if (command.hasErrors()) {
render view: 'index', model: [command: command]
return
}
.
.
.
.
****************************************************
My Register controller:
package testapp1
import grails.plugins.springsecurity.ui.RegisterCommand
import org.codehaus.groovy.grails.plugins.springsecurity.ui.RegistrationCode
import org.codehaus.groovy.grails.plugins.springsecurity.SpringSecurityUtils
class RegisterController extends grails.plugins.springsecurity.ui.RegisterController {
def register(RegisterCommand command) {
println "In my RegisterController.register()"
}
|