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
Post a Comment