客户jsp技术
jsp技术 时间:2021-02-26 阅读:(
)
Huihoo-EnterpriseOpenSourcehttp://www.
huihoo.
com1XMLAllenLongEmail:allen@huihoo.
comhttp://www.
huihoo.
com2004-04Huihoo-EnterpriseOpenSourcehttp://www.
huihoo.
com2内容安排XML基础Java+XML简介JavaAPIforXML–JAXP(ProcessingAPI)–JAXB(ProjectAdelard)–JAXM(MessagingAPI-ebXML)–XML和Java2平台,企业版Huihoo-EnterpriseOpenSourcehttp://www.
huihoo.
com3XML是什么XML–ExtensibleMarkupLanguageBaseduponHTMLDescribeyourowntagsUsesDTD(DocumentTypeDefinition)todescribethedataXMLisnotareplacementforHTMLXMLisalanguageforcreatingotherlanguagesDocumentsfollowthecustomlanguageauserdevelopsfromXMLLabeledinformationinXMLcanbereusedNeedtofollowtherulesaccordinglyHuihoo-EnterpriseOpenSourcehttp://www.
huihoo.
com4HTML存在的问题DonotgiveinformationaboutcontentofthewebpageHardtobeabletoreusethisinformationHTMLarehardtodisplayfrombrowser'spointofviewbecauseofHTML'ssimplicityLimitedinareasofformattinganddynamiccontentHuihoo-EnterpriseOpenSourcehttp://www.
huihoo.
com5JAVA与XML完美结合1.
Java平台是一种跨平台的编程环境2.
XML是一种跨平台的数据格式3.
几乎所有的XML工具使用的都是Java编程语言4.
与其他语言相比,Java平台提供了更好的XML支持Huihoo-EnterpriseOpenSourcehttp://www.
huihoo.
com6JAXP-Java平台上的解析API用户应用参考解析器其他解析器JAXP接口Huihoo-EnterpriseOpenSourcehttp://www.
huihoo.
com7JAXP用于解析的瘦型、轻量级API用于转换XML文档的API可嵌入式的解析器和XSLT引擎解析XML使用:事件驱动(SAX)基于树型结构(DOM)XSL转换Huihoo-EnterpriseOpenSourcehttp://www.
huihoo.
com8SAXSimpleAPIforXML的缩写串行存取文档轻量级、快速编程较难仅用于串行存取org.
xml.
sax.
*Huihoo-EnterpriseOpenSourcehttp://www.
huihoo.
com9SAX对应的HandlerXML文档解析器事件输入Huihoo-EnterpriseOpenSourcehttp://www.
huihoo.
com10JAXP/SAX代码例子01importjava.
xml.
parsers.
*;02importorg.
xml.
sax.
*;0304SAXParserFactoryfactory=05SAXParserFactory.
newInstance();06factory.
setValidating(true);07SAXParserparser=factory.
newSAXParser();08parser.
parse("config.
xml",handler);0910//canalsoparseInputStreams,Files,and11//SAXinputsourcesHuihoo-EnterpriseOpenSourcehttp://www.
huihoo.
com11DOMDocumentObjectModel的缩写通过树型结构存取XML文档由元素节点和文本节点组成可以在树的某个节点上向前或向后移动与SAX相比需要更大的内存org.
w3c.
dom.
*Huihoo-EnterpriseOpenSourcehttp://www.
huihoo.
com12DOM解析器创建的树输入XML文档Huihoo-EnterpriseOpenSourcehttp://www.
huihoo.
com13JAXP/DOM代码例子01importjava.
xml.
parsers.
*;02importorg.
w3c.
dom.
*;0304DocumentBuilderFactoryfactory=05DocumentBuilderFactory.
newInstance();06factory.
setValidating(true);07DocumentBuilderbuilder=08factory.
newDocumentBuilder();09Documentdoc=10builder.
parse("config.
xml");1112//canalsoparseInputStreams,Files,and13//SAXinputsourcesHuihoo-EnterpriseOpenSourcehttp://www.
huihoo.
com14JAXP中的XSLTAPIjavax.
xml.
transformXSLT处理器的基本接口集定义了TransformerFactory和Transformer类定义了Templates,SourceandResult接口Templates表示处理指令在Source和Result接口中可以使用SAX,DOM和streamHuihoo-EnterpriseOpenSourcehttp://www.
huihoo.
com15Transform的代码例子01importjava.
xml.
transform.
*;0203Transformertrans;04TransformerFactorfac=new05TransformerFactory.
newInstance();06try{07//Createatranformforastylesheet08trans=fac.
newTransformer(09newStreamSource(stylesheet));10//ApplytransformtoSystem.
out11trans.
transform(newStreamSource(source),12newStreamResult(System.
out));13}catch(Exceptione){14//handleerror15}Huihoo-EnterpriseOpenSourcehttp://www.
huihoo.
com16解析器的指定使用系统属性查找Factoryjavax.
xml.
parsers.
SAXParserFactoryjavax.
xml.
parsers.
DocumentBuilderFactoryjavax.
xml.
parsers.
TransformerFactory通过改变属性可以使用任意的解析器$JAVA_HOME/lib/jaxp.
properties文件Huihoo-EnterpriseOpenSourcehttp://www.
huihoo.
com17改变属性Command:java-Djavax.
xml.
parsers.
SAXParserFactory=MyParserFactoryMyClassCode:System.
setProperty("javax.
xml.
parsers.
SAXParserFactory","foo.
bar.
MyParserFactory");Huihoo-EnterpriseOpenSourcehttp://www.
huihoo.
com18用于XML绑定的JavaAPI-JAXBHuihoo-EnterpriseOpenSourcehttp://www.
huihoo.
com19XML数据绑定XML=可移动的数据XML代表的数据没有任何意义模式(Schemas)为XML增加了意义绑定使XML可以容易地在程序中使用UnmarshalMarshalXML消息对象Huihoo-EnterpriseOpenSourcehttp://www.
huihoo.
com20XML=没有意义的数据Brown91/2它们相同吗Huihoo-EnterpriseOpenSourcehttp://www.
huihoo.
com21模式(Schemas)为XML增加了意义模式=XML消息的语义和语法描述XML消息对象类XML模式遵从:实例化:Huihoo-EnterpriseOpenSourcehttp://www.
huihoo.
com22在程序中使用XML对应XML消息的类publicclassShoeOrder{publicShoeOrder(Stringid,Stylestyle,Stringcolor,Stringsize);publicStringgetId();publicvoidsetId(Stringid);publicStylegetStyle();publicvoidsetStyle(Stylestyle);publicStringgetColor();publicvoidsetColor(Stringcolor);publicStringgetSize();publicvoidsetSize(Stringsize);}Huihoo-EnterpriseOpenSourcehttp://www.
huihoo.
com23在程序中使用XMLMarshalling/unmarshalling代码PublicvoidacceptOrder(InputStreamin){ShoeOrderso=unmarshal(in);WarehouseDB.
submit(so);}编写unmarshalHuihoo-EnterpriseOpenSourcehttp://www.
huihoo.
com24在程序中使用XML如何编写unmarshal使用SAX!
privatestaticShoeOrdernewOrder=null;staticclassDocHandlerimplementsDocumentHandler{publicvoidsetDocumentLocator(Locatorl){}publicvoidstartDocument(){}publicvoidendDocument(){}publicvoidignorableWhitespace(char[]cbuf,intoffset,intlen){}publicvoidprocessingInstruction(Stringtarget,Stringdata){}ShoeOrderso=null;Stringcur=null;publicvoidstartElement(Stringname,AttributeListal){if(name.
equals("ShoeOrder")){so=newShoeOrder();for(inti=0,n=al.
getLength();iJSP技术互相补充–操作XML以完成不同的任务–来自XML的数据数据库查询–通用数据+XSLT作为表现层Huihoo-EnterpriseOpenSourcehttp://www.
huihoo.
com38产生XMLWAP客户RIMPalmVPalmVII客户转换器XML.
.
.
.
.
.
JSP页面Huihoo-EnterpriseOpenSourcehttp://www.
huihoo.
com39多客户译码器WAP客户RIMPalmVPalmVII客户转换器.
.
.
.
.
.
HTML客户WML客户译码器XML网络层Huihoo-EnterpriseOpenSourcehttp://www.
huihoo.
com40多客户XSLTStylesheetWAP客户RIMPalmVPalmVII客户转换器.
.
.
.
.
.
WAP客户RIMPalmVPalmVII客户转换器.
.
.
.
.
.
HTML客户WML客户XSLTStylesheetXML网络层Huihoo-EnterpriseOpenSourcehttp://www.
huihoo.
com41用于XML注册的JavaAPI---JAXRJavaAPIforXMLRegistries注册是B2B协作中的一个第三方工具JAXR是用于XML注册的统一的应用编程接口ebXML,UDDI等等.
Huihoo-EnterpriseOpenSourcehttp://www.
huihoo.
com42基于RPC方式处理XML的JavaAPIJavaAPIforXMLbasedRPC用途Marshalling和Unmarshalling参数将基于XML的调用定义映射为Java接口、类和方法,或者进行反向映射将会成为W3C的XML协议(XP)Huihoo-EnterpriseOpenSourcehttp://www.
huihoo.
com43JDOMJDOM设计体系–隐藏了XML的复杂性–利用了Java2语言的强大功能–利用了方法过载、CollectionsAPIs、Reflection、弱引用–提供类型转换JDOM与DOM的区别就在于代表Document(文档)、Elements(元素)和Attributes(属性)的JDOM的类是模块化的,更像传统的JAVA类包说明org.
jdomDOM的JDOM实现org.
jdom.
adapters处理XML解析器的JDOM适配器org.
jdom.
input内含使用DOM或SAX创建文档的类org.
jdom.
output内含向流发送DOM树或创建SAX2事件的类Huihoo-EnterpriseOpenSourcehttp://www.
huihoo.
com44内容回顾XML基础Java+XML简介JavaAPIforXML–JAXP(ProcessingAPI)–JAXB(ProjectAdelard)–JAXM(MessagingAPI-ebXML)–XML和Java2平台,企业版Huihoo-EnterpriseOpenSourcehttp://www.
huihoo.
com45总结Java+XML代表了可移植的数据和行为Java+XML关注–标准体–通过JCP的JavaAPIs–鼓励标准的实现–利用已存在的平台—Java2,J2EE,JSP等等Huihoo-EnterpriseOpenSourcehttp://www.
huihoo.
com46参考资料http://www.
w3.
org/XML/w3c的xml站点http://www.
xml.
org/xml站点http://java.
sun.
com/xmlsun公司的xml站点http://www.
huihoo.
com国内一个关于中间件的专业站点Huihoo-EnterpriseOpenSourcehttp://www.
huihoo.
com47结束谢谢大家!
Allen@huihoo.
comhttp://www.
huihoo.
com
- 客户jsp技术相关文档
- 实验jsp技术
- 零件jsp技术
- "2:广东科学技术职业学院2014年公开招聘聘用制教师计划表",,,,,,,
- "姓名","学号","班级","导师","毕业论文题目","答辩结果"
- "计算机科学与技术系毕业设计中期检查"
- "北京理工大学继续教育暨现代远程教育学院",,
官方网站:点击访问特网云官网活动方案:===========================香港云限时购==============================支持Linux和Windows操作系统,配置都是可以自选的,非常的灵活,宽带充足新老客户活动期间新购活动款产品都可以享受续费折扣(只限在活动期间购买活动款产品才可享受续费折扣 优惠码:AADE01),购买折扣与续费折扣不叠加,都是在原价...
NameSilo是通过之前的感恩节优惠活动中认识到这家注册商的,于是今天早上花了点时间专门了解了NameSilo优惠码和商家的详细信息。该商家只销售域名,他们家的域名销售价格还是中规中矩的,没有像godaddy域名标价和使用优惠之后的价格悬殊很大,而且其特色就是该域名平台提供免费的域名停放、免费隐私保护等功能。namesilo新注册域名价格列表,NameSilo官方网站:www.namesilo....
商家介绍:创梦云是来自国内的主机销售商,成立于2018年4月30日,创梦云前期主要从事免备案虚拟主机产品销售,现在将提供5元挂机宝、特惠挂机宝、香港云服务器、美国云服务器、低价挂机宝等产品销售。主打高性价比高稳定性挂机宝、香港云服务器、美国云服务器、香港虚拟主机、美国虚拟主机。官方网站:http://cmy0.vnetdns.com本次促销产品:地区CPU内存硬盘带宽价格购买地址香港特价云服务器1...
jsp技术为你推荐
可以发外链的论坛可以发外链的论坛有那些?google竞价排名谷歌竞价排名现在是显示在什么位置?邮箱打不开怎么办我的邮箱打不开怎么办显卡温度多少正常显卡温度多少算正常网易公开课怎么下载网易公开课的视频该如何下载?腾讯文章怎样才能在手机腾讯网上发表文章?怎么升级ios6iPad怎么升级到iOS6正式版?ejb开发什么是ejb?小米手柄小米蓝牙游戏手柄怎么连接游戏怎么上传音乐怎么上传音乐
免费域名 免费国际域名 花生壳免费域名 免费cn域名 香港机房 私服服务器 宕机监控 贵州电信宽带测速 lamp配置 dropbox网盘 php空间推荐 美国堪萨斯 双线机房 国外在线代理服务器 东莞主机托管 阿里云邮箱申请 好看的空间 月付空间 dmz主机 国内免备案空间 更多