0
votes

I am new in grails i am using commmand object for login validation. it work fine in development environment but not work in production environment

   def login={LoginCommand loginCommand->
    if(!loginCommand.hasErrors()){
        ........
    }
    else{
        .............
    }
    render(view:"/student/login",model:[loginCommand:loginCommand])
}
2
How is it failing? Please post the error message or stacktrace. - ataylor

2 Answers

2
votes

The code example posted by @Tomasz wouldn't make a difference.

Using methods or closures just works. Your problem lies elsewhere.

  • Like @ataylor said, please post the error message, check your stacktraces, etc.
  • Investigate the differences between your development environment and the production environment(external views, packaging issues, etc.).
0
votes

For controller actions prefer methods over closures. This should work:

def login(LoginCommand loginCommand) {
    if(!loginCommand.hasErrors()){
    ........
    } else {
    .............
    }
    render(view:"/student/login",model:[loginCommand:loginCommand])
}