176142998

            BlogJava :: 首頁 :: 聯系 :: 聚合  :: 管理
            116 Posts :: 0 Stories :: 45 Comments :: 0 Trackbacks
          在spring2.0中,bean沒有“singleton”這個屬性,而是在“scope”中對它進行設定。“scope”可以設定為“singleton”和“prototype”默認情況下是“singleton”即和原先的“singleton=true”性質一樣,如果要實現單例模式則將“scope”設定為“prototype”,即和原先版本的“singleton=false”一樣。參考文檔鏈接地址:http://www.springframework.org/schema/beans/spring-beans-2.0.xsd



          根據用戶名和密碼進行校驗的方法
           public boolean verify(String userName, String userPwd) {
            final String HQL="FROM UserTable u where u.userName=? and u.userPwd=?";
            String[] hqlParameter=new String[2];
            hqlParameter[0]=userName;
            hqlParameter[1]=userPwd;
            List list=this.getHibernateTemplate().find(HQL,hqlParameter);
            if(list.size()>0){
             return true;
            }
            
            return false;
           }
          posted on 2008-07-09 13:03 飛飛 閱讀(2962) 評論(0)  編輯  收藏

          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 和平区| 庐江县| 肇庆市| 太仓市| 麟游县| 白银市| 若羌县| 城步| 美姑县| 普兰县| 宣恩县| 洞头县| 瓦房店市| 禄劝| 花垣县| 灵丘县| 望城县| 夏河县| 雷州市| 黎城县| 上饶县| 浠水县| 琼结县| 同心县| 西乡县| 贺兰县| 城固县| 柯坪县| 喀喇| 庄浪县| 昭苏县| 凭祥市| 汉寿县| 怀远县| 胶南市| 白城市| 碌曲县| 宜昌市| 左云县| 渝北区| 台州市|