书籍详情

基于J2EE的Ajax宝典

基于J2EE的Ajax宝典

作者:李刚

出版社:电子工业出版社

出版时间:2007-05-01

ISBN:9787121042584

定价:¥89.00

购买这本书可以去
内容简介
  Ajax技术是目前最流行的技术,它极大地改善了传统Web应用的用户体验,因此也被称为对传统Web技术的革命。.本书介绍的内容非常全面,覆盖了Ajax技术的各个方面,包括Ajax技术的核心对象XMLHttpRequest对象、JavaScript脚本的详细知识以及DOM和XML的相关知识。除了Ajax的这些基础知识外,本书还详细介绍了Ajax的5个相关框架:Prototype.js,Dojo,DWR,JSON-RPC-Java和AjaxTags。..本书介绍的不是单纯的Ajax技巧,而是侧重于介绍Ajax技术与J2EE技术的融合,让Ajax技术融入实际的J2EE应用。本书适用于有一定J2EE编程基础的读者,因为单纯的Ajax技术是没有太大用处的。通过阅读本书,不但可以掌握Ajax的开发技巧,而且可以掌握如何让Ajax技术和J2EE应用实现完美融合。
作者简介
  李刚,从事过近7年的J2EE应用开发,担任过LITEON公司的J2EE技术主管,负责该公司的企业信息平台的架构设计,担任过广东龙泉科技有限公司的J2EE技术培训导师,目前在新东方IT培训中心担任J2EE培训讲师。培训的学生已在华为、从兴电子、瑞达通信、中企动力等公司就职,在珠三角的J2EE行业极具影响力。
目录
第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
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
第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
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
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
4.4.1  内部DTD····· 137
4.4.2  外部DTD····· 138
4.4.3  公用DTD····· 139
4.5  DTD的语法············· 139
4.5.1  定义元素······ 140
4.5.2  定义子元素····················· 142
4.5.3  定义元素属性················· 146
4.5.4  定义实体引用················· 149
4.6  Schema的语法········· 151
4.6.1  Schema的基本语法········ 152
4.6.2  定义简单元素················· 152
4.6.3  定义元素的父子结构关系················ 153
4.6.4  引用元素······ 154
4.6.5  Schema中的内置类型···· 156
4.6.6  自定义简单数据类型····· 156
4.6.7  自定义复杂数据类型····· 160
4.6.8  定义空元素····················· 163
4.6.9  定义混合内容元素········· 164
4.6.10 定义属性······ 165
4.6.11 元素组与属性组············· 166
4.7  使用JavaScript解析DOM········ 168
4.7.1  DOM简介···· 168
4.7.2  解析XML文档·············· 169
4.7.3  创建XML文档·············· 172
4.8  小结······· 173
第5章  使用CSS级联样式单··· 174
5.1  样式单概述·············· 174
5.2  CSS样式单的基本使用方式····· 175
5.2.1  引入外部样式文件········· 176
5.2.2  使用内部样式定义········· 177
5.2.3  使用内联样式················· 179
5.3  使用CSS属性········· 180
5.3.1  文字相关属性················· 181
5.3.2  整体段落相关属性········· 182
5.3.3  背景相关属性················· 184
5.3.4  表格相关属性················· 186
5.3.5  大小相关属性················· 189
5.3.6  定位相关属性················· 189
5.3.7  边框相关属性················· 191
5.3.8  轮廓相关属性················· 194
5.3.9  常用属性······ 194
5.4  选择器定义·············· 196
5.4.1  属性选择器····················· 196
5.4.2  ID选择器····· 198
5.4.3  class选择······ 199
5.4.4  包含选择器和子元素选择器············ 199
5.4.5  超链接相关选择器········· 200
5.5  在脚本中修改显示样式············· 201
5.5.1  随机改变页面的背景色···················· 201
5.5.2  导航菜单效果················· 202
5.5.3  卷帘效果······ 203
5.5.4  动态增加立体效果········· 205
5.6  小结······· 206
第6章  DOM模型详解················ 207
6.1  DOM模型简介········ 207
6.1.1  DOM模型的概念··········· 207
6.1.2  DOM模型的作用··········· 208
6.2  XML和DOM模型···················· 208
6.2.1  XML和DOM················· 209
6.2.2  使用DOM解析XML文档·············· 209
6.2.3  使用SAX解析XML文档··············· 212
6.2.4  使用DOM解析器创建XML··········· 215
6.3  HTML文档和DOM模型········· 217
6.3.1  HTML文档简介············· 217
6.3.2  HTML文档的DOM结构················ 218
6.4  DOM中的HTML元素············· 219
6.4.1  HTML元素之间的继承图················ 219
6.4.2  HTML元素之间的常见包含关系···· 220
6.5  使用JavaScript控制DOM········ 221
6.5.1  创建节点······ 221
6.5.2  修改节点······ 222
6.6  添加节点·················· 224
6.6.1  为下拉列表增加选项····· 225
6.6.2  动态生成表格················· 226
6.7  删除节点·················· 227
6.7.1  删除下拉列表的选项····· 229
6.7.2  删除表格的行或单元格···················· 230
6.8  两个常用范例·········· 232
6.8.1  可编辑表格····················· 232
6.8.2  导航菜单······ 234
6.9  小结······· 239
第7章  事件处理机制·················· 240
7.1  基本事件模型·········· 240
7.1.1  绑定HTML元素属性···· 240
7.1.2  绑定对象属性················· 243
7.1.3  使用addEventListener方法绑定······· 246
7.2  深入了解事件模型····················· 247
7.2.1  事件处理函数的范围····· 247
7.2.2  使用返回值改变默认行为················ 248
7.2.3  JavaScript中的MVC······ 249
7.2.4  在代码中触发事件········· 253
7.3  Netscape 4的事件模型··············· 255
7.3.1  事件对象······ 255
7.3.2  事件捕捉······ 257
7.4  Internet Explorer的事件模型······ 259
7.4.1  在Internet Explorer中绑定事件处理器··············· 259
7.4.2  使用script for绑定········· 259
7.4.3  使用attachEvent()方法执行绑定······· 260
7.4.4  事件对象······ 260
7.4.5  事件传递······ 264
7.4.6  重定向·········· 266
7.5  DOM级别2的事件模型··········· 268
7.5.1  绑定事件处理函数········· 269
7.5.2  事件传播和转发············· 270
7.5.3  取消事件的默认行为····· 271
7.5.4  控制事件传播················· 272
7.5.5  转发事件······ 273
7.5.6  DOM 2中的事件············ 274
7.6  小结······· 275
第8章  使用DHTML动态操作HTML文档················· 276
8.1  DHTML和DOM两种模型······ 276
8.2  使用DHTML··········· 277
8.2.1  DHTML的包含体系······ 277
8.2.2  使用Window对象·········· 278
8.3  文档对象·················· 284
8.4  表单和表单元素······ 286
8.4.1  表单和表单元素对象····· 286
8.4.2  Form对象的方法和属性··················· 287
8.4.3  Text和Textarea················ 288
8.4.4  Radio和ChechBox········· 289
8.4.5  Select和Option··············· 290
8.5  小结······· 294
第9章  XMLHttpRequest对象详解············ 295
9.1  XMLHttpRequest对象概述········ 295
9.2  XMLHttpRequest的方法和属性··················· 296
9.2.1  XMLHttpRequest的方法··················· 296
9.2.2  XMLHttpRequest的属性··················· 299
9.3  发送请求·················· 304
9.3.1  发送简单请求················· 304
9.3.2  发送GET请求················ 306
9.3.3  发送POST请求············· 310
9.3.4  发送请求时的编码问题···················· 311
9.3.5  发送XML请求·············· 316
9.4  处理服务器响应······ 318
9.4.1  处理的时机····················· 318
9.4.2  使用文本响应················· 319
9.4.3  使用XML响应·············· 319
9.4.4  使用DOM模型生成页面················· 321
9.5  XMLHttpRequest对象的运行周期··············· 322
9.6  Ajax必须解决的问题················· 322
9.6.1  跨浏览器问题················· 323
9.6.2  安全问题······ 324
9.6.3  性能问题······ 326
9.7  小结······· 330
第3部分  Ajax常用框架············· 331
第10章  Prototype框架详解····· 332
10.1  Prototype的下载和安装··········· 332
10.1.1  Prototype概述············· 332
10.1.2  下载Prototype············· 333
10.1.3  安装Prototype············· 333
10.2  使用Prototype的基本函数······ 334
10.2.1  使用$()函数················· 334
10.2.2  使用$A()函数·············· 337
10.2.3  使用$F()函数··············· 339
10.2.4  使用$H()函数·············· 340
10.2.5  使用$R()函数·············· 341
10.2.6  使用Try.these()函数···· 342
10.3  Prototype的自定义对象和类··· 343
10.3.1  使用Element对象······· 343
10.3.2  使用Enumerable类····· 346
10.3.3  使用Field对象操作表单域··········· 350
10.3.4  使用Form对象操作表单·············· 351
10.3.5  使用Form.Element对象················ 353
10.3.6  使用Hash对象··········· 354
10.3.7  使用Class对象··········· 355
10.3.8  用于操作HTML元素的类··········· 356
10.3.9  常用的监听器·············· 357
10.4  Prototype的常用扩展··············· 359
10.4.1  扩展Array··················· 359
10.4.2  扩展Document············ 361
10.4.3  扩展String··················· 361
10.4.4  扩展Event···················· 363
10.5  Prototype为Ajax增加的类····· 364
10.5.1  使用Ajax.Request类····················· 364
10.5.2  使用Ajax.Responders对象··········· 368
10.5.3  使用Ajax对象············ 369
10.5.4  使用Ajax.Updater类····················· 369
10.5.5  使用Ajax.PeriodicalUpdater类······ 374
10.6  小结····· 376
第11章  基于Prototype的应用:实现自动完成功能················· 377
11.1  应用的基本分析和设计··········· 377
11.1.1  数据要求··· 377
11.1.2  数据表结构·················· 378
11.2  Domain Object和持久层·········· 378
11.2.1  Domain Object·············· 378
11.2.2  实现DAO组件··········· 381
11.3  实现Service组件··· 385
11.4  使用Servlet提供服务器响应····················· 388
11.4.1  实现根据前缀查询品牌················· 389
11.4.2  实现根据品牌查询型号················· 390
11.4.3  实现根据型号查询具体描述········· 391
11.5  客户端HTML页面实现·········· 392
11.6  增加HTML页面的事件响应能力············· 394
11.6.1  实现品牌输入框的事件处理函数···················· 395
11.6.2  实现键盘事件处理函数················· 397
11.6.3  根据品牌提示型号······ 399
11.6.4  根据型号显示描述······ 401
11.6.5  注册Ajax事件监听器··················· 403
11.7  小结····· 404
第12章  使用Dojo···· 405
12.1  初识Dojo··············· 405
12.1.1  Dojo概述····················· 405
12.1.2  下载和安装Dojo········· 406
12.2  了解Dojo的体系····················· 408
12.2.1  通用库······· 408
12.2.2  Ajax相关库················· 409
12.2.3  页面控件相关库·········· 409
12.2.4  其他相关库·················· 409
12.3  使用Dojo的通用库················· 410
12.3.1  使用djConfig对象······ 410
12.3.2  do对象的函数············· 412
12.3.3  字符串相关函数·········· 414
12.3.4  扩展函数··· 416
12.3.5  DOM相关函数··········· 421
12.4  Dojo的Ajax支持····················· 425
12.4.1  使用Dojo开发Ajax应用············· 425
12.4.2  发送请求的几种形式····················· 427
12.4.3  使用queueBind函数发送请求队列················· 431
12.4.4  使用dojo.io.setIFrameSrc函数代替XMLHttpRequest······ 431
12.4.5  使用dojo.io.argsFromMap函数···· 432
12.5  Dojo的事件机制··· 433
12.5.1  简单的connect绑定···· 433
12.5.2  使用对象的方法作为事件处理器···················· 434
12.5.3  为非DOM元素绑定事件处理器···················· 435
12.6  基于connect的AOP实现······· 436
12.6.1  简单的before绑定······ 437
12.6.2  简单的around绑定····· 437
12.6.3  访问目标方法参数的绑定············· 439
12.6.4  与around绑定在一起使用的监听器··············· 440
12.7  connect绑定其他函数·············· 441
12.7.1  使用connectBefore······ 441
12.7.2  使用connectAround···· 441
12.7.3  使用connectOnce········ 442
12.7.4  使用kwConnect··········· 442
12.7.5  使用disconnect············ 443
12.7.6  使用kwDisconnect······ 443
12.8  基于Topic事件机制················· 443
12.9  Dojo的拖拉功能··· 444
12.9.1  自由拖动··· 445
12.9.2  有相对“坐标”的移动··· 446
12.9.3  带手柄的移动·············· 448
12.10  Dojo的常用widget·················· 449
12.10.1  按钮········· 449
12.10.2  对话框····· 451
12.10.3  日历········· 454
12.10.4  树············· 457
12.10.5  Tab页······ 459
12.11  Dojo与Prototype的对比········ 461
12.12 小结····· 461
第13章  基于Dojo的动态树····· 462
13.1  自关联Domain Object的设计···················· 462
13.2  基于Hibernate的DAO实现··· 464
13.2.1  DAO组件的接口········ 464
13.2.2  DAO组件的实现类···· 465
13.3  基于Spring的业务逻辑组件··· 467
13.3.1  业务逻辑组件的接口····················· 467
13.3.2  业务逻辑组件的实现类················· 468
13.3.3  配置Spring容器········· 471
13.4  基于Spring的集成测试··········· 473
13.5  Dojo树的相关Widget·············· 475
13.5.1  使用TreeContextMenu··················· 475
13.5.2  使用TreeRPCController················· 478
13.6  Dojo树的HTML页面实现····· 479
13.7  实现服务器响应Servlet··········· 484
13.7.1  实现getAllRoot··········· 484
13.7.2  实现updateNode·········· 486
13.7.3  实现createChild··········· 487
13.7.4  实现removeNode········ 489
13.7.5  实现getChildren·········· 490
13.8  与其他树的对比···· 491
13.9  小结····· 493
第14章  使用DWR··· 494
14.1  DWR的下载和安装················· 494
14.1.1  DWR概述··················· 494
14.1.2  下载和安装DWR······· 495
14.2  使用DWR·············· 500
14.2.1  编写处理类·················· 500
14.2.2  配置DWR··················· 502
14.3  使用DWR的转换器················ 504
14.3.1  基本转换器·················· 504
14.3.2  对象转换器·················· 504
14.3.3  数组转换器·················· 507
14.3.4  集合类型转换器·········· 508
14.4  方法声明················ 509
14.5  使用DWR的创建器················ 510
14.5.1  创建器的配置·············· 510
14.5.2  使用new创建器········· 512
14.5.3  使用none创建器········ 512
14.5.4  使用script创建器······· 513
14.6  调用服务器端的方法··············· 514
14.6.1  调用服务器端方法的通用配置····· 514
14.6.2  使用简单回调·············· 516
14.6.3  使用JSON格式的回调················· 524
14.6.4  将客户端参数传递到回调函数····· 526
14.7  使用engine.js········· 526
14.7.1  设置调用顺序·············· 527
14.7.2  设置全局超时时长······ 527
14.7.3  设置全局Hook函数··· 527
14.7.4  设置全局处理函数······ 528
14.7.5  设置常用的全局选项····················· 528
14.7.6  批处理······· 528
14.8  使用util.js··············· 529
14.8.1  使用$()······ 530
14.8.2  处理列表··· 530
14.8.3  处理表格··· 535
14.8.4  访问HTML元素值···· 540
14.8.5  工具函数··· 542
14.9  整合第三方J2EE框架············· 545
14.9.1  访问Servlet API·········· 545
14.9.2  整合Spring·················· 546
14.9.3  整合Struts··················· 549
14.10 异常处理················ 551
14.11 反向Ajax················ 553
14.11.1  配置使用反向Ajax··· 553
14.11.2  在Java方法中操作Web页········· 554
14.11.3  在客户端调用反向Ajax方法····· 556
14.12 小结····· 557
第15章  基于DWR的Ajax应用:即时消息系统····· 558
15.1  实现Hibernate持久层·············· 558
15.1.1 Hibernate持久层的POJO············· 558
15.1.2  将POJO映射为持久化对象········· 560
15.2  实现DAO组件····· 562
15.2.1  扩展HibernateDaoSupport来实现分页··········· 562
15.2.2  实现DAO组件··········· 565
15.3  实现业务逻辑组件··················· 570
15.3.1  业务逻辑组件的接口····················· 570
15.3.2  业务逻辑组件的实现类················· 572
15.3.3  部署业务逻辑组件······ 576
15.4  调用业务逻辑组件··················· 578
15.4.1  将Spring容器中的Bean创建成JavaScript对象·············· 578
15.4.2  处理用户登录·············· 580
15.4.3  处理用户注册·············· 582
15.4.4  处理消息发布·············· 583
15.4.5  获取消息列表·············· 585
15.4.6  处理分页··· 587
15.4.7  查看消息内容·············· 587
15.4.8  页面加载函数·············· 589
15.4.9  客户端HTML页面···· 589
15.5  小结····· 592
第16章  JSON-RPC-Java框架详解·········· 593
16.1  使用JSON············· 593
16.1.1  JSON的语法··············· 593
16.1.2  发送JSON请求·········· 596
16.2  JSON-RPC-Java的下载和安装·················· 599
16.2.1  JSON-RPC-Java概述···················· 600
16.2.2  下载和安装JSON-RPC-Java········ 600
16.3  使用JSON-RPC-Java完成Ajax交互······· 601
16.3.1  映射服务器端JSONRPCServlet··· 601
16.3.2  编写处理类·················· 601
16.3.3  使用JSONRPCBridge··················· 602
16.3.4  在JSP中使用JSONRPCBridge··· 603
16.3.5  在Servlet中使用JSONRPCBridge················· 603
16.3.6  暴露处理类对象·········· 604
16.3.7  暴露处理类的实例方法················· 604
16.3.8  暴露处理类的静态方法················· 604
16.3.9  调用服务器端方法······ 605
16.3.10  JSON-RPC-Java的基本流程········ 606
16.3.11 基本应用的代码实现····················· 606
16.4  使用Java对象作为参数和返回值············· 611
16.4.1  使用对象作为参数······ 611
16.4.2  使用对象作为返回值····················· 617
16.4.3  使用集合对象作为返回值············· 619
16.5  访问Web环境······· 624
16.6  JSON-RPC-Java与DWR的对比··············· 626
16.7  小结····· 627
第17章  基于JSON-RPC-Java的Ajax应用:在线相册·········· 628
17.1  实现Hibernate持久层·············· 628
17.1.1  设计Hibernate的持久化类··········· 628
17.1.2  完成配置文件和映射文件············· 630
17.1.3  数据库的设计·············· 632
17.2  实现DAO组件····· 633
17.2.1  DAO接口定义············ 633
17.2.2  完成DAO组件的实现类·············· 635
17.3  实现服务器处理类··················· 637
17.4  实现客户端调用···· 642
17.4.1  暴露Java对象············· 642
17.4.2  处理用户登录·············· 643
17.4.3  周期性地获得用户相片列表········· 647
17.4.4  处理用户注册·············· 647
17.4.5  处理上传··· 650
17.5  客户端JSP页面···· 654
17.6  小结····· 656
第18章  使用AjaxTags简化开发·············· 657
18.1  AjaxTags的下载和安装··········· 657
18.1.1  AjaxTags概述·············· 657
18.1.2  下载和安装AjaxTags····················· 658
18.2  AjaxTags入门········ 660
18.2.1  编写处理类·················· 660
18.2.2  使用标签··· 662
18.3  处理类的几种形式··················· 663
18.3.1  使用普通Servlet生成响应············ 664
18.3.2  使用AjaxXmlBuilder辅助类········ 665
18.3.3  使用BaseAjaxAction生成响应····· 668
18.3.4  使用BaseAjaxServlet生成响应···· 671
18.3.5  使用非Java响应········· 673
18.4  AjaxTags常用标签的使用······· 674
18.4.1  使用自动完成标签······ 674
18.4.2  使用area标签············· 679
18.4.3  使用anchors标签······· 680
18.4.4  使用callout标签········· 681
18.4.5  使用htmlContent标签··················· 683
18.4.6  使用portlet标签·········· 686
18.4.7  使用select标签··········· 688
18.4.8  创建Tab页·················· 689
18.4.9  使用displayTag标签··· 691
18.4.10 使用updateField标签···················· 694
18.5  关于AjaxTags的选择·············· 696
18.5.1  AjaxTags的优势和使用场景········· 696
18.5.2  AjaxTags的缺点·········· 697
18.6  小结····· 697
第19章  Ajax案例:Blog系统···················· 698
19.1  实现Hibernate持久层·············· 698
19.1.1  设计Hibernate的持久化类··········· 698
19.1.2  完成映射文件·············· 701
19.1.3  数据表的结构·············· 704
19.2  实现DAO组件····· 704
19.2.1  DAO接口定义············ 705
19.2.2  分页实现··· 706
19.2.3  DAO组件的实现········ 708
19.2.4  配置DAO组件··········· 711
19.3  实现业务逻辑组件··················· 712
19.3.1  业务逻辑组件的接口····················· 712
19.3.2  业务逻辑组件的实现类················· 713
19.3.3  配置业务逻辑组件······ 717
19.4  在客户端暴露业务逻辑组件··· 718
19.4.1  初始化Spring容器····· 718
19.4.2  定义DWR的核心Servlet············· 719
19.4.3  将Spring容器中的Bean转化成JavaScript对象·············· 720
19.5  在客户端调用JavaScript对象···················· 721
19.5.1  获取Blog文章列表···· 721
19.5.2  控制Blog文章列表的翻页··········· 723
19.5.3  页面加载时的动作······ 723
19.5.4  查看评论··· 724
19.5.5  控制评论的翻页·········· 726
19.5.6  添加评论··· 727
19.5.7  查看Blog文章内容···· 729
19.5.8  添加新的Blog文章···· 729
19.6  系统视图················ 731
19.7  小结····· 734
第20章  Ajax综合应用:电子拍卖系统··· 735
20.1  总体设计和概要说明··············· 735
20.1.1  系统的总体架构设计····················· 735
20.1.2  系统的模块结构图······ 736
20.1.3  系统用例图·················· 737
20.1.4  数据库设计·················· 738
20.2  详细设计················ 739
20.3  Domain层实现······· 740
20.3.1  设计Domain Object····· 740
20.3.2  Domain Object的代码实现············ 741
20.3.3  完成Hibernate映射···· 748
20.4  DAO层实现·········· 752
20.4.1  DAO的基础配置········ 753
20.4.2  DAO接口的类图········ 754
20.4.3  DAO接口的定义········ 755
20.4.4  DAO组件的实现········ 759
20.4.5  DAO组件的配置········ 766
20.5  业务逻辑层实现···· 767
20.5.1  业务逻辑组件设计······ 767
20.5.2  业务逻辑组件的异常处理············· 769
20.5.3  业务逻辑组件的邮件发送············· 769
20.5.4  业务层组件的实现······ 770
20.5.5  业务层的权限控制······ 779
20.5.6  业务层的任务调度······ 780
20.5.7  事务管理··· 781
20.5.8  业务层的配置·············· 781
20.6  测试····· 786
20.6.1  测试DAO组件··········· 786
20.6.2  测试业务层组件·········· 788
20.6.3  测试的运行·················· 789
20.7  将业务逻辑组件暴露给客户端·················· 790
20.7.1  初始化Spring容器····· 790
20.7.2  配置DWR的核心Servlet············· 791
20.7.3  暴露业务逻辑组件······ 791
20.8  调用业务逻辑方法响应用户请求·············· 793
20.8.1  系统的HTML页面···· 793
20.8.2  处理返回首页的请求····················· 806
20.8.3  页面加载时的函数······ 806
20.8.4  浏览所有流拍物品······ 807
20.8.5  处理用户登录·············· 809
20.8.6  管理物品··· 814
20.8.7  管理物品种类·············· 818
20.8.8  查看竞得的物品·········· 822
20.8.9  查看自己的竞标·········· 824
20.8.10 浏览拍卖物品·············· 825
20.8.11 对物品竞价·················· 828
20.9  小结····· 831
猜您喜欢

读书导航