posts - 431,  comments - 344,  trackbacks - 0
          比如當應用啟動時候往user表中添加一條數據,修改 grails-app\config\BootStrap.groovy 的代碼:
           

          class BootStrap {

              def init = { servletContext ->

                  def user = new Users(id:1,username:'rain'

                     ,password:'1102')

                  user.password = user.password.encodeAsPassword()

                  user.save()

              }

              def destroy = { }

          }
          posted on 2008-07-28 23:02 周銳 閱讀(576) 評論(0)  編輯  收藏 所屬分類: Groovy&Grails
          主站蜘蛛池模板: 延吉市| 西峡县| 松潘县| 革吉县| 宁乡县| 阿拉尔市| 大厂| 永寿县| 廊坊市| 金堂县| 巴彦淖尔市| 大城县| 阿鲁科尔沁旗| 阳山县| 泰宁县| 灌云县| 宜宾市| 承德市| 福鼎市| 德州市| 仙居县| 葵青区| 屏东县| 盈江县| 平塘县| 肥东县| 灵台县| 磐安县| 苏州市| 唐山市| 叶城县| 雷州市| 黑山县| 景谷| 连云港市| 哈巴河县| 徐闻县| 织金县| 白水县| 涞源县| 景德镇市|