BlueSpace
思想有多遠,我們就能走多遠!
BlogJava
::
首頁
::
新隨筆
::
聯系
::
聚合
::
管理
posts - 0, comments - 5, trackbacks - 0
<
2025年5月
>
日
一
二
三
四
五
六
27
28
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
留言簿
(1)
給我留言
查看公開留言
查看私人留言
我參與的團隊
深圳Java俱樂部(0/0)
文章分類
ajax(1)
hibernate(4)
java(21)
javasrcipt(13)
mysql數據庫(6)
spring
文章檔案
2009年8月 (1)
2009年3月 (2)
2008年10月 (1)
2008年7月 (3)
2008年6月 (11)
2008年3月 (1)
2008年2月 (1)
2007年12月 (11)
2007年11月 (3)
2007年9月 (13)
相冊
my photo
http://www.tkk7.com/beansoft
http://www.tkk7.com/sterning
http://www.tkk7.com/sterning
搜索
最新評論
1.?re: xfire aegis轉
評論內容較長,點擊標題查看
--啊啊啊
2.?re: xfire aegis轉
itn
--吃飯會非常
3.?re: distinct 與 order by
“select * from test group by name”這個SQL語句有問題,執行不了
--didi
4.?re: java讀取excel文件
good,so well,
--1111
5.?re: 正則表達式,不區分大小寫的替換
評論內容較長,點擊標題查看
--新手。
java記取xml配置文件
需要用到commons-logging-1.0.4.jar,dom4j-1.4.jar包
?1
import?java.io.File;
?2
import?java.io.IOException;
?3
?4
import?org.apache.commons.logging.Log;
?5
import?org.apache.commons.logging.LogFactory;
?6
import?org.dom4j.Document;
?7
import?org.dom4j.io.SAXReader;
?8
?9
/**
10
?*?@author?wufalong
11
?*
12
?*?TODO?To?change?the?template?for?this?generated?type?comment?go?to
13
?*?Window?-?Preferences?-?Java?-?Code?Style?-?Code?Templates
14
?*/
15
public?class?LoadRootElementByConfigFile?{
16
????private?static?Log?log?=?LogFactory.getLog(LoadRootElementByConfigFile.class);
17
????public?static?Document?getRootElement(){
18
????????String?path="";
19
????????File?file?=?new?File(".");
20
????????try
21
????????{
22
????????????path?=?file.getCanonicalPath();
23
????????}
24
????????catch?(IOException?e)
25
????????{
26
????????????e.printStackTrace();
27
????????}
28
29
????????Document?document?=?null;
30
????????String?filePath?=?"";
31
????????try{?
32
????????????filePath?=?path+"/config.xml";
33
????????????File?f?=?new?File(filePath);??//服務器運行目錄
34
????????????SAXReader?reader?=?new?SAXReader();
35
????????????document?=?reader.read(f);
36
????????}catch(Exception?e){?
37
????????????filePath?=?path+"/src/config.xml";
38
????????????File?f?=?new?File(filePath);?//eclipse調試目錄
39
????????????SAXReader?reader?=?new?SAXReader();
40
????????????try{
41
????????????????document?=?reader.read(f);
42
????????????}catch(Exception?ex){
43
????????????????
44
????????????}
45
????????}
46
????????log.info("配置文件路徑:"+filePath);
47
????????return?document;????
48
????}
49
}
posted on 2007-09-03 10:59
crazy
閱讀(256)
評論(0)
編輯
收藏
所屬分類:
java
新用戶注冊
刷新評論列表
只有注冊用戶
登錄
后才能發表評論。
網站導航:
博客園
IT新聞
Chat2DB
C++博客
博問
管理
相關文章:
java HttpClient
html正則處理
正則2
正則
java的時間處理
xfire 集合 aegis
xfire aegis轉
轉載
判斷是否存在中文
java正則表達式
Powered by:
BlogJava
Copyright ©2025 crazy
主站蜘蛛池模板:
亚洲毛片av日韩av无码
|
成人爱做日本视频免费
|
亚洲愉拍99热成人精品热久久
|
亚洲另类无码一区二区三区
|
4hu四虎最新免费地址
|
亚洲欧洲日产v特级毛片
|
亚洲一区二区三区免费在线观看
|
久久久久亚洲精品成人网小说
|
免费成人在线电影
|
久久久久久久亚洲Av无码
|
久久99精品视免费看
|
亚洲天堂一区二区
|
亚洲综合免费视频
|
国产亚洲玖玖玖在线观看
|
热99re久久精品精品免费
|
无码天堂亚洲国产AV
|
亚洲欧洲久久久精品
|
91在线视频免费观看
|
亚洲伊人tv综合网色
|
67194熟妇在线永久免费观看
|
国产精品高清视亚洲精品
|
热久久精品免费视频
|
j8又粗又长又硬又爽免费视频
|
亚洲综合伊人久久综合
|
久久午夜无码免费
|
在线精品亚洲一区二区
|
免费一看一级毛片
|
久久精品免费视频观看
|
亚洲va成无码人在线观看
|
亚洲第一区在线观看
|
日韩中文字幕免费视频
|
亚洲精品无码你懂的
|
亚洲爆乳无码一区二区三区
|
h片在线免费观看
|
免费国产黄网站在线观看动图
|
国产亚洲精品a在线观看app
|
一个人免费观看www视频在线
|
亚洲va乱码一区二区三区
|
免费不卡中文字幕在线
|
免费国产污网站在线观看15
|
亚洲色大成网站www久久九
|