隨筆:15 文章:206 評論:35 引用:0
fenglin
創新、創意、挑戰
C++博客
首頁
發新隨筆
發新文章
聯系
聚合
管理
Spring3_初始化屬性(SimpleProperty)
package
com.bebig.dao.impl;
import
com.bebig.dao.UserDAO;
import
com.bebig.model.User;
//
數據訪問接口的實現
public
class
UserDAOImpl
implements
UserDAO
{
private
int
daoId;
private
String daoStatus;
public
int
getDaoId()
{
return
daoId;
}
public
void
setDaoId(
int
daoId)
{
this
.daoId
=
daoId;
}
public
String getDaoStatus()
{
return
daoStatus;
}
public
void
setDaoStatus(String daoStatus)
{
this
.daoStatus
=
daoStatus;
}
@Override
public
void
save(User u)
{
System.out.println(
"
a user saved!
"
);
System.out.println(
"
daoId=
"
+
this
.getDaoId());
System.out.println(
"
daoStatus=
"
+
this
.getDaoStatus());
}
}
beans.xml
<?
xml version="1.0" encoding="UTF-8"
?>
<
beans
xmlns
="http://www.springframework.org/schema/beans"
xmlns:xsi
="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context
="http://www.springframework.org/schema/context"
xsi:schemaLocation
="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd"
>
<!--
a service object; we will be profiling its methods
-->
<
bean
name
="u"
class
="com.bebig.dao.impl.UserDAOImpl"
>
<!--
通過property來指定屬性的初始值
-->
<
property
name
="daoId"
value
="100"
></
property
>
<
property
name
="daoStatus"
value
="best"
></
property
>
</
bean
>
<
bean
id
="userService"
class
="com.bebig.service.UserService"
>
<
constructor-arg
>
<
ref
bean
="u"
/>
</
constructor-arg
>
</
bean
>
</
beans
>
發表于 2010-10-18 12:15
風林
閱讀(641)
評論(0)
編輯
收藏
引用
所屬分類:
Spring
只有注冊用戶
登錄
后才能發表評論。
【推薦】100%開源!大型工業跨平臺軟件C++源碼提供,建模,組態!
相關文章:
SSH&MySQL數據存取亂碼
Spring3.0.4&Struts2.2.1&Hibernate3.5.6整合過程總結
SSH_亂碼問題解決辦法
Struts2_openSessionInView的相關問題
SSH_could not initialize proxy - no Session
Spring3_BasicDataSource存在內存泄漏的解決辦法
什么是AOP?AOP用在哪些方面?
Spring3_Spring&Hibernate_HibernateDaoSupport(方法二)
Spring3_Spring&Hibernate_HibernateDaoSupport(方法一)
Spring3_Spring&Hibernate_HibernateTemplate
網站導航:
博客園
IT新聞
BlogJava
博問
Chat2DB
管理
CALENDER
<
2025年7月
>
日
一
二
三
四
五
六
29
30
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
1
2
3
4
5
6
7
8
9
常用鏈接
我的隨筆
我的評論
我參與的隨筆
留言簿
給我留言
查看公開留言
查看私人留言
隨筆分類
jBPM
(rss)
隨筆檔案
2011年7月 (1)
2011年4月 (1)
2011年2月 (1)
2010年11月 (1)
2010年10月 (2)
2010年9月 (3)
2010年8月 (4)
2010年7月 (2)
文章分類
AJAX(2)
(rss)
Android(2)
(rss)
C#(20)
(rss)
C++(6)
(rss)
ckeditor&ckfinder(1)
(rss)
CSS
(rss)
Delphi(2)
(rss)
Hibernate(39)
(rss)
JAVA(95)
(rss)
jQuery(1)
(rss)
JSP(9)
(rss)
Maven(1)
(rss)
MySQL(4)
(rss)
OOP(1)
(rss)
Python(42)
(rss)
Spring(31)
(rss)
SQL Server(4)
(rss)
Struts2(35)
(rss)
SVN(1)
(rss)
Tomcat(1)
(rss)
Ubuntu(1)
(rss)
軟件加解密技術
(rss)
雜文(1)
(rss)
文章檔案
2011年8月 (1)
2011年7月 (3)
2011年6月 (19)
2011年5月 (2)
2011年4月 (1)
2011年2月 (1)
2010年12月 (2)
2010年11月 (21)
2010年10月 (67)
2010年9月 (48)
2010年8月 (37)
2010年7月 (4)
新聞檔案
2010年7月 (1)
相冊
CSS
Hibernate
搜索
最新評論
1.?re: Struts2_三種傳參數方法
方式的發生
--阿飛史蒂夫
2.?re: 在Win7上搭建JSP開發環境
評論內容較長,點擊標題查看
--鄒
3.?re: ckeditor&ckfinder&s2sh集成
評論內容較長,點擊標題查看
--庸幾何
4.?re: 在Win7上搭建JSP開發環境
下個 myeclipse@lou
--孫毅
5.?re: 在Win7上搭建JSP開發環境
@lou
運行 -cmd 找到startup.bat 在java 環境中運行
--孫毅
閱讀排行榜
1.?開始找Java開發類工作了(510)
2.?給一家公司的軟件做加密方案(443)
3.?一流、二流、三流(421)
4.?周一到周五都得出差,周末才能回(420)
5.?最近工作有點忙(381)
評論排行榜
1.?周一到周五都得出差,周末才能回(2)
2.?給力2011(2)
3.?最近工作有點忙(0)
4.?生活(0)
5.?在博客園開博了(0)
Powered By:
博客園
模板提供
:
滬江博客
精品国产乱码久久久久久呢
|
免费国产99久久久香蕉
|
7777精品伊人久久久大香线蕉
|
一级做a爰片久久毛片毛片
|
亚洲综合伊人久久大杳蕉
|
国产婷婷成人久久Av免费高清
|
国产精品熟女福利久久AV
|
久久久一本精品99久久精品88
|
国产精品99精品久久免费
|
国产精品久久久久乳精品爆
|
国产69精品久久久久APP下载
|
久久99久久99精品免视看动漫
|
久久久久亚洲AV成人片
|
久久电影网
|
国内精品久久久久影院优
|
无码8090精品久久一区
|
精品国产一区二区三区久久久狼
|
久久夜色精品国产噜噜亚洲a
|
国产成人综合久久综合
|
亚洲色婷婷综合久久
|
久久本道久久综合伊人
|
www久久久天天com
|
午夜精品久久久久久久
|
亚洲欧美国产精品专区久久
|
国产精品免费久久久久影院
|
99久久免费国产精精品
|
看久久久久久a级毛片
|
18禁黄久久久AAA片
|
亚洲国产精品无码久久久久久曰
|
亚洲综合久久综合激情久久
|
2021久久精品国产99国产精品
|
国产69精品久久久久久人妻精品
|
久久夜色撩人精品国产
|
久久久精品视频免费观看
|
国产巨作麻豆欧美亚洲综合久久
|
欧美一区二区精品久久
|
色噜噜狠狠先锋影音久久
|
国产99久久久久久免费看
|
久久久久久毛片免费看
|
亚洲午夜久久久
|
久久婷婷五月综合97色一本一本
|