文件名称:基于j2ee的ajax宝典
文件大小:1.36MB
文件格式:PDF
更新时间:2013-05-05 10:16:22
基于j2ee的ajax宝典
第1部分 初识Ajax······ 1 第1章 Ajax入门··········· 2 1.1 重新思考Web应用····· 2 1.1.1 应用系统的发展史············· 2 1.1.2 传统Web应用的优势和缺点··············· 4 1.2 重新设计Web应用····· 5 1.2.1 RIA应用·········· 5 1.2.2 异步发送请求并避免等待···················· 7 1.2.3 使用Ajax·········· 7 1.3 Ajax简介··· 8 1.3.1 Ajax的工作方式················· 8 1.3.2 XMLHttpRequest················· 9 1.3.3 JavaScript语言·················· 10 1.3.4 HTML页面的DOM········ 10 1.3.5 数据交换和显示··············· 11 1.4 Ajax的基本特征········ 12 1.5 Ajax的替代技术········ 13 1.5.1 Sun的Java Web Start技术·················· 13 1.5.2 Microsoft的ClickOnce技术··············· 13 1.5.3 基于Flash的Flex············· 14 1.6 搭建开发运行环境···· 15 1.6.1 本书的Ajax环境·············· 15 www.j2eedve.com 制作:找不着北 第 2 页 2007-7-27 1.6.2 Windows下JDK的安装···················· 15 1.6.3 Linux下JDK的安装······· 19 1.6.4 安装Tomcat服务器·········· 20 1.6.5 配置Tomcat的服务端口····················· 22 1.6.6 进入控制台···· 22 1.6.7 部署Web应用·················· 24 1.6.8 配置Tomcat的数据源······ 25 1.6.9 安装Ant工具··················· 28 1.6.10 安装Eclipse开发环境······ 28 1.6.11 在线安装········ 29 1.6.12 手动安装········ 30 1.7 小结········· 31 第2章 Ajax初体验···· 32 2.1 Ajax带来的优势········ 32 2.2 传统的JSP聊天室···· 34 2.2.1 实现业务逻辑组件··········· 35 2.2.2 实现控制器···· 38 2.2.3 实现视图········ 40 2.2.4 JSP聊天室的问题············ 41 2.3 Ajax聊天室················ 42 2.3.1 异步发送请求··················· 42 2.3.2 解决多余刷新的问题······· 44 2.3.3 解析服务器响应··············· 47 2.3.4 何时发送请求··················· 48 2.3.5 Ajax聊天室的特点··········· 52 2.4 传统Web应用与Ajax的对比····· 52 2.5 小结········· 53 www.j2eedve.com 制作:找不着北 第 3 页 2007-7-27 第2部分 Ajax基本技术··············· 55 第3章 JavaScript关键语法详解················· 56 3.1 JavaScript简介··········· 56 3.2 数据类型和变量········ 57 3.2.1 定义变量的方式··············· 57 3.2.2 类型转换········ 58 3.2.3 变量················ 60 3.3 基本数据类型············ 62 3.3.1 数字类型········ 62 3.3.2 字符串类型···· 67 3.3.3 布尔类型········ 70 3.3.4 undefined和null················ 71 3.4 复合类型···················· 71 3.4.1 对象················ 72 3.4.2 数组················ 72 3.4.3 函数················ 73 3.5 运算符····· 75 3.5.1 赋值运算符···· 75 3.5.2 算术运算符···· 76 3.5.3 位运算符········ 78 3.5.4 加强的赋值运算符··········· 79 3.5.5 比较运算符···· 80 3.5.6 逻辑运算符···· 81 3.5.7 三目运算符···· 82 3.5.8 逗号运算符···· 84 3.5.9 void运算符···· 84 3.5.10 typeof运算符····················· 85 www.j2eedve.com 制作:找不着北 第 4 页 2007-7-27 3.6 语句········· 85 3.6.1 语句块············ 85 3.6.2 空语句············ 86 3.6.3 异常抛出语句··················· 86 3.6.4 异常捕捉语句··················· 87 3.6.5 with语句········ 88 3.7 流程控制···················· 89 3.7.1 分支················ 89 3.7.2 while循环······· 91 3.7.3 do while循环····················· 92 3.7.4 for循环··········· 93 3.7.5 for in循环······· 94 3.7.6 break和continue··············· 95 3.8 函数········· 97 3.8.1 函数定义········ 98 3.8.2 局部变量和局部函数······· 99 3.8.3 匿名函数······ 100 3.8.4 函数的成员属性和静态属性············ 102 3.8.5 递归函数······ 104 3.9 函数的参数传递······ 106 3.9.1 基本类型参数和复合类型参数········ 106 3.9.2 空参数·········· 107 3.9.3 参数类型······ 108 3.10 对象······· 109 3.10.1 面向对象的概念··········· 109 3.10.2 JavaScript中的对象······ 110 3.10.3 继承和prototype··········· 110 www.j2eedve.com 制作:找不着北 第 5 页 2007-7-27 3.11 创建对象·················· 114 3.11.1 使用new关键字创建对象·············· 115 3.11.2 使用Object直接创建对象·············· 115 3.11.3 使用JSON语法创建对象·············· 118 3.12 小结······· 119 第4章 XML详解······ 120 4.1 XML概述················ 120 4.1.1 标记语言······ 120 4.1.2 XML的定义和发展史··· 121 4.2 XML的文档规则···· 122 4.2.1 XML文档分类··············· 122 4.2.2 XML文档的整体结构··· 124 4.2.3 XML声明···· 125 4.2.4 XML元素···· 127 4.2.5 字符数据······ 129 4.2.6 注释·············· 131 4.2.7 处理指令······ 132 4.3 XML数据岛············ 133 4.3.1 数据岛概述····················· 133 4.3.2 在HTML文档中载入XML文档···· 134 4.3.3 将XML数据绑定到表格输出········· 134 4.4 DTD与Schema········ 137