Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Jute Powerful Forum  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
作者 Jute的属性配置
rainman

阿熊

元老


发贴: 5644
积分: 454
于 2002-07-31 12:20 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
配置文件采用XMl格式编写,使用XPath读取节点属性。

 

<?xml version="1.0" encoding="gb2312"?>

<sys>

  <path>
  
    <root description="系统根目录绝对路径">
      e:/project/jute
    </root>      
    <conf>${"sys/path/root"}/webapps/WEB-INF/conf</conf>
        
  </path>
  
  <charset>
    <encoding description="系统采用的字符编码">
      GBK
    </encoding>
  </charset>
  
  <log>
    <config>
      ${"sys/path/root"}/webapps/WEB-INF/conf/syslog.xml
    </config>    
    <message>
      ${"sys/path/root"}/webapps/WEB-INF/conf/logmessage.xml
    </message>  
  </log>

</sys>

eg. Config.getSystemConfig().getString("/sys/log/config") 将读出 e:/project/jute/webapps/WEB-INF/conf/syslog.xml
${"sys/path/root"}为引用文件内其他节点,引号内可为任何有效的XPath表达式




作者 回复: Jute的属性配置 [Re:rainman]
M?



发贴: 0
积分: 0
于 2002-07-31 17:48 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
建议将tag <charset>去掉,直接使用UTF-8的编码,同时conf文件的编码也使用utf-8.


作者 回复: 回复: Jute的属性配置 [Re:M?]
rainman

阿熊

元老


发贴: 5644
积分: 454
于 2002-07-31 22:37 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
M? wrote:
建议将tag <charset>去掉,直接使用UTF-8的编码,同时conf文件的编码也使用utf-8.


全部用utf-8编码是可以的,但手工编辑配置文件的时候会有麻烦,特别是在linux下。




作者 回复: Jute的属性配置 [Re:rainman]
M?



发贴: 0
积分: 0
于 2002-08-01 00:22 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
我倒是认为增加这么一点麻烦是比较值得的。Smile
而且linux下面,unicode的编辑器现在逐渐多起来了,
如果不用vi编辑的话,还是容易办到的。
(当然vi也可以编辑了)


M? edited on 2002-08-01 00:23


flat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923