当前位置:首页 » 软件开发
开发技术指南» 文章正文
    引言: sonnet.xml 这是在本教程中贯穿使用的示例XML文档。
 

 

 ·选择合适的java脚本语言    »显示摘要«
    摘要: 选择合适的java脚本语言--如果你正考虑在java应用中集成脚本解释器,最难得是决定使用那种摘要:脚本语言已经向java开发者证明了它的价值。它让客户实现应用功能的扩展和界面的个性化,从而程序的价值得以提升。另外,它们可以显著的简化程序开发者的设计任务,通过实现动态定义、装载和评估。对于开发人员,集成一种或多种脚本语言的任务是简单的,从越来越长的可选列表中选出一个确实困难的。......
    摘要: 什么是io   io(input/output)是计算机输出/输出的接口。java的核心库java.io提供了全面的io接口,包括:文件读写,标准设备输出等等。java中io是以流为基础进行输入输出的,所有数据被串行化写入输出流,或者从输入流读入。此外,java也对块传输提供支持,在核心库java.nio中采用的便是块io。关于nio我们在后面还有专门的讨论。  流io的好处是......


JavaXML教程(附:源程序)
上一页   ... /*  * (c) copyright ibm corp. 1999 all rights reserved.  *  * us government users restricted rights use, duplication or  * disclosure restricted by gsa adp schedule contract with ibm corp.  *  * the program is provided "as is" without any warranty express or  * implied, including the warranty of non-infringement and the implied  * warranties of merchantibility and fitness for a particular purpose.  * ibm will not be liable for any damages suffered by you as a result  * of using the program. in no event will ibm be liable for any  * special, indirect or consequential damages or lost profits even if  * ibm has been advised of the possibility of their occurrence. ibm  * will not be liable for any third party claims against you.  */  import java.io.outputstreamwriter;  import java.io.printwriter;  import java.io.unsupportedencodingexception;  import org.w3c.dom.attr;  import org.w3c.dom.document;  import org.w3c.dom.namednodemap;  import org.w3c.dom.node;  import org.w3c.dom.nodelist;  import com.ibm.xml.parsers.*;  /**  * domone.java  * illustrates how to go through a dom tree.  */  public class domone  {  public void parseandprint(string uri)  {  document doc = null;  try  {  domparser parser = new domparser();  parser.parse(uri);  doc = parser.getdocument();  }  catch (exception e)  {  system.err.println("sorry, an error occurred: " + e);  }  // we`ve parsed the document now, so let`s print it.  if (doc != null)  printdomtree(doc);  }  /** prints the specified node, then prints all of its children. */  public void printdomtree(node node)  {  int type = node.getnodetype();  switch (type)  {  // print the document element  case node.document_node:  {  system.out.println("<?xml version="1.0" ?>");  printdomtree(((document)node).getdocumentelement());  break;  }  // print element with attributes  case node.element_node:  {  system.out.print("<");  system.out.print(node.getnodename());  namednodemap attrs = node.getattributes();  for (int i = 0; i < attrs.getlength(); i++)  {  node attr = attrs.item(i);  system.out.print(" " + attr.getnodename() +  "="" + attr.getnodevalue() +  """);&nb
...   下一页
    摘要: //articleconn.jsp 数据库连接文件,几乎被每个页面包含,有的页面去掉获得session,修改一下这个代码,很简单<%@ page contenttype="text/html;charset=big5"%><%@ page import="java.sql.*"%> <% request.se......
» 本期热门文章:

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