How to write query in grails controller -


i using grails 1.3.7. sending username , password view page controller. , it's rendering correctly on browser. need write query collect data username , password database. have no idea how write query in grails controller. can please me on ? here action below want write query logging in home page >>>

def loginaction = {     def username = params?.username     def password = params?.password     def val = username + "  ---  " +password     render val } 

something like:

def loginaction = {     def username = params?.username     def password = params?.password     user user = user.findbyusername(username)     def val = user?.password == password ? 'valid' : 'invalid'     render val } 

but should read docs gorm - http://grails.org/doc/latest/guide/gorm.html


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -