当前位置:首页 » 编程博文
开发技术指南» 文章正文
    引言: copyright 1999-2003 by Ronald
 

 

    摘要: 在说明问题之前,首先要介绍一下tomcat的工作原理。大家都知道,jsp可以说是servlet的一种简单写法,它本质还是一个servlet,只是将一些servlet对象设为默认对象,并简化了html的输出方式,在运行时,相应请求的机制和servlet基本是一个道理。因此,当第一次请求一个jsp页面的时候,tomcat(或其他容器)都要首先将jsp转化为servlet class。这其中有两个步骤......
    摘要:(接续上一节) 确定你的客户第三个问题是:“谁是我的客户?”在你的事业中,为了生存和壮大,你必须要满足谁的需要?当然,你的第一个客户就是你的老板,就是签发你工资支票的那个人。你工作的根本职责是保证满足他或她的根本需要。你知道这些需要是什么吗? 你可以把客户定义为依靠你获得成功的任何人,或你所赖以获得成功的任何人。在这个定义之下,你的同事和员工也是你的客户。周围你所帮助的......


XML与数据库
上一页   ... <salesorder sonumber="12345"> <customer custnumber="543"> <custname>abc industries</custname> <street>123 main st.</street> <city>chicago</city> <state>il</state> <postcode>60609</postcode> </customer> <orderdate>981215</orderdate> <item itemnumber="1"> <part partnumber="123"> <description> <p><b>turkey wrench:</b><br /> stainless steel, one-piece construction, lifetime guarantee.</p> </description> <price>9.95</price> </part> <quantity>10</quantity> </item> <item itemnumber="2"> <part partnumber="456"> <description> <p><b>stuffing separator:<b><br /> aluminum, one-year guarantee.</p> </description> <price>13.27</price> </part> <quantity>5</quantity> </item> </salesorder>

除了像销售订单这种显而易见的以数据为中心的文档之外,许多以文本为主的(prose- rich)文档也可以是以数据为中心的.例如,amazon.com用来显示书籍信息的一个页面.尽管页面上大部分内容都是文本,这些文本的结构是非常规则的,许多都与其它书籍的描述相同,每个页面特有的文本并不很多.这样,就可以从数据库中取出书籍的相关资料,转换为简单的.以数据为中心的xml文档,再用xsl样式表生成页面.一般来说,那些用数据库中的数据填充模板,动态生成html文件的网站都可以转而使用一系列以数据为中心的xml文档与xsl样式表.

<flightinfo> <airline>abc airways</airline> provides <count>three</count> non-stop flights daily from <origin>dallas</origin> to <destination>fort worth</destination>. departure times are <departure>09:15</departure>, <departure>11:15</departure>, and <departure>13:15</departure>. arrival times are minutes later. </flightinfo>

从下面的xml文件与一个简单的样式表中创建这个文档: 【程序编程相关:Tomcat4/5连接池的设置及简单应用

例如,下面是个描述航班信息的文档: 【推荐阅读:.NET 框架中的 XML:在 .NET

以文档为中心的文档通常是供人消费的.例如书籍.email.广告以及几乎所有人工写成的xhtml文件.其特性为结构不太或根本不规则.数据粒度大(larger grained data)(最小的独立数据单位可能存在于包含混合内容的元素甚至整个文档本身),混合内容多.同级元素或pcdata出现的次序一般来说总是非常重要的. 【扩展信息:非常小的shell: 指定行号,插入文本

<flights> <airline>abc airways</airline> <origin>dallas</origin> <destination>fort worth</destination> <flight> <departure>09:15</departure> <arrival>09:16</arrival> </flight> <flight> <departure>11:15</departure> <arrival>11:16</arrival> </flight> <flight> <departure>13:15</departure> <arrival>13:16</arrival> </flight> </flights>

4.2 以文档为中心的文档 (document-centric documents)

以文档为中心的文档通常是以xml手工写成,或从其他格式(如rtf, pdf, sgml)转换到xml,与以数据为中心的文档不同,它们的来源通常不是数据库.(将数据插入到模板而得到的文档是以数据为中心的;更多信息请看4.1节末尾部分).将各种格式转换为xml的软件信息,请参阅xml软件相关链接.

例如,下面这个产品说明是以文档为中心的:

<product> <intro> the <productname>turkey wrench</productname> from <developer>full fabrication labs, inc.</developer> is <summary>like a monkey wrench, but not as big.</summary> </intro> <description> <para>the turkey wrench, which comes in <i>both right- and left- handed versions (skyhook optional)</i>, is made of the <b>finest stainless steel</b>. the readi-grip rubberized handle quickly adapts to your hands, even in the greasiest situations. adjustment is possible through a variety of custom dials.</para> <para>you can:</para> <list> <item><link url="order.html">order your own turkey wrench</link></item> <item><link url="wrenches.htm">read more about wrenches</link></item> <item><link url="catalog.zip">download the catalog</link></item> </list> <para>the turkey wrench costs <b>just $19.99</b> and, if you order now, comes with a <b>hand-crafted shrimp hammer</b> as a bonus gift.</para> </description> </product>

4.3 数据.文档与数据库(data, documents, and databases)

在现实当中,以数据为中心与以文档为中心的文档之间的差别不一定很明显.例如,另一种以数据为中心的文档比如发票,可能含有大粒度的.结构不规则的数据比如零件说明;另一种以文档文中心的文件如用户手册,可能包含细粒度的结构规则的数据(通常为元数据)比如作者与修订日期.
...   下一页

 ·asp开发规范    »显示摘要«
    摘要:asp开发规范 ——写这个东西请多多指教,以后开发时好少吃点苦头。</p><p>一、单页编写规范: 切记页面要分模块来写: 第一模块:接收参数。[有可能从不同页面提交到同一个页面;也可能出现两个表单项以哪个优先的处理。 第二模块:定义全局变量。 第三模块:写处理代码(尽量将代码都包含到函数中,详见页面附注一。)。——到此asp......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE