了解一些从xml中读取数据的技术 如DOM SAX JOX;
eg:
DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder();
Configuration conf = builder.buildFromFile(filepath) ;
Configuration[] confs = conf.getChildren() ;
for(int i = 0; i < confs.length ; i++){
String key = confs[i].getAttribute("name") ;
System.out.println(confs[i].getAttribute("name"));
BaseData dataSource = new BaseData(confs[i]);
map.put(key, dataSource);
eg:
DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder();
Configuration conf = builder.buildFromFile(filepath) ;
Configuration[] confs = conf.getChildren() ;
for(int i = 0; i < confs.length ; i++){
String key = confs[i].getAttribute("name") ;
System.out.println(confs[i].getAttribute("name"));
BaseData dataSource = new BaseData(confs[i]);
map.put(key, dataSource);
解决方案 »
- jmx遇到了个问题大家帮忙看下
- fckeditor复制中文的时候,自动换行
- 超多JAVA,DotNet视频共享 [希望能置顶让更多朋友下载到]
- 求面试官常问的Hibernate的问题?
- Struts 中<html:link>用法请教..
- jboss部署错误
- No processor available, rejecting this connection是怎么回事啊?
- [转载&改编]一步一步开发Spring Framework MVC应用程序-6(Intellij IDEA版)
- arraycopy 报异常
- 小弟初学CMP/CMR,有个问题想向老鸟们请教
- 用jbuilder9.0将ejb发布成web服务时?
- 那位高知道在Tomcat中,如何在部署时就自动把jsp页面编译成.class?
像你说的作配置文件
还可以做文件数据库
还可以用它来处理多个系统的接口问题
还可以代替html
这个用起来也不难
不过一般项目用不到吧
1. As page:
xml+xsl2. As configurable file:
apply in such web.xml,server.xml or your config.xml( defined by you)3. Implement invoking at html:
XMLHttp ( get xml document or other from Server in Javascript)4. Apply in web services:
provides some tools to you, and with standard something ( e.g. SOAP,WSDL and so on)5. Parse using DOM or SAX in many languages.6. It's easy to implement a tree in IE
(using xml+xsl)6. As small Database stores datas
(Search using XPATH, access using DOM,SAX and so on)7. If you knew it, you will feel easy when maybe use it in your projects.8. more and more than I can't say.....
在apache的XML项目组中,目前有Xerces Xalan Cocoon几个开发XML相关技术的project.
Tomcat本身使用的是 Sun 的 JAXP,而其XSL Taglib project中使用Xerces解析器.
<dbhost>localhost</dbhost>
<dbname>sqlname</dbname>
<dbuser>username</dbuser>
<dbpassword>password</dbpassword>
</datasource></myenv>
上面这个myenv.xml配置文件一般是放在tomcat的WEB-INF/classes目录下.
(注:上述知识点学自板桥的--XML配置文件的读取处理--,感觉特别不错)
我个人觉得xml最大的应用在于xml+xslt开发web应用
XSLT、jdom、sax就连javascript里面也可以处理XMLXML无处不在!
对于作为客户的网站来说,购买了某个互联网服务,不必专门设立服务器,购买大量软件,还要维护他们,只要通过直接调用提供该功能的Web Services就可以,比如购物车功能,这是每个网上商店都必须的,但每个商家不一定去购买这个软件,只要在自己网页中直接调用网上商店的Web Services就可以。
三个意思
可扩展//写自己的标记
标记//像html一样
语言//可实现语言的功能