0

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])
}
ataylor
  • 64,891
  • 24
  • 161
  • 189
Piyush Chaudhari
  • 962
  • 3
  • 19
  • 41

2 Answers2

2

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.).
rimero
  • 2,383
  • 1
  • 14
  • 8
0

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])
}
Tomasz Kalkosiński
  • 3,673
  • 1
  • 19
  • 25