没有合适的资源?快使用搜索试试~ 我知道了~
Sun - Core Servlets and JavaServer Pages.pdf
1星 需积分: 10 77 下载量 121 浏览量
2009-07-06
10:56:23
上传
评论
收藏 11.14MB PDF 举报
温馨提示
试读
617页
Sun - Core Servlets and JavaServer Pages Sun - Core Servlets and JavaServer Pages
资源推荐
资源详情
资源评论
Overview of On-Line Version
We hope you enjoy this PDF version of the international bestseller Core Servlets and
JavaServer Pages (Sun Microsystems Press). If you are interested in purchasing the
book, it is available through most major on-line and brick-and-mortar bookstores.
See http://www.coreservlets.com
for details.
Interested in the sequel? Check out More Servlets and JavaServer Pages at
http://www.moreservlets.com
.
Looking for servlet and JSP short courses taught by the author?
Visit http://courses.coreservlets.com
. Available on-site at your company or at public
venues.
Complete searchable PDF version offered exclusively through the Java Lobby:
http://www.javalobby.org. Join now!
v
Chapter
© Prentice Hall and Sun Microsystems. Personal use only; do not redistribute.
Home page for this book: http://www.coreservlets.com.
Home page for sequel: http://www.moreservlets.com.
Servlet and JSP training courses: http://courses.coreservlets.com.
Acknowledgments xix
About the Author xx
Introduction xxi
Real Code for Real Programmers xxii
How This Book Is Organized xxiii
Conventions xxvii
About the Web Site xxvii
Part 1
Servlets 2.1 and 2.2 2
Chapter 1
Overview of Servlets and JavaServer Pages 4
1.1 Servlets 5
1.2 The Advantages of Servlets Over “Traditional” CGI 7
Efficient 7
Convenient 7
Table of Contents
vi Contents
© Prentice Hall and Sun Microsystems. Personal use only; do not redistribute.
Powerful 8
Portable 8
Secure 8
Inexpensive 9
1.3 JavaServer Pages 9
1.4 The Advantages of JSP 10
Versus Active Server Pages (ASP) 10
Versus PHP 10
Versus Pure Servlets 11
Versus Server-Side Includes (SSI) 11
Versus JavaScript 11
Versus Static HTML 12
1.5 Installation and Setup 12
Obtain Servlet and JSP Software 12
Bookmark or Install the Servlet and JSP API Documentation 14
Identify the Classes to the Java Compiler 14
Package the Classes 15
Configure the Server 16
Start the Server 17
Compile and Install Your Servlets 18
Chapter 2
First Servlets 20
2.1 Basic Servlet Structure 21
2.2 A Simple Servlet Generating Plain Text 23
Compiling and Installing the Servlet 24
Invoking the Servlet 25
2.3 A Servlet That Generates HTML 26
2.4 Packaging Servlets 27
Creating Servlets in Packages 28
Compiling Servlets in Packages 29
Invoking Servlets in Packages 30
2.5 Simple HTML-Building Utilities 31
2.6 The Servlet Life Cycle 34
The init Method 34
The service Method 36
Contents vii
© Prentice Hall and Sun Microsystems. Personal use only; do not redistribute.
The doGet, doPost, and doXxx Methods 37
The SingleThreadModel Interface 38
The destroy Method 38
2.7 An Example Using Initialization Parameters 39
2.8 An Example Using Servlet Initialization and Page Modification Dates 44
2.9 Debugging Servlets 50
2.10 WebClient: Talking to Web Servers Interactively 52
WebClient 52
HttpClient 55
NetworkClient 57
SocketUtil 59
CloseableFrame 60
LabeledTextField 61
Interruptible 63
Chapter 3
Handling the Client Request: Form Data 64
3.1 The Role of Form Data 65
3.2 Reading Form Data from Servlets 66
3.3 Example: Reading Three Explicit Parameters 67
3.4 Example: Reading All Parameters 70
3.5 A Resumé Posting Service 74
3.6 Filtering Strings for HTML-Specific Characters 87
Code for Filtering 88
Example 89
Chapter 4
Handling the Client Request: HTTP Request Headers 92
4.1 Reading Request Headers from Servlets 94
4.2 Printing All Headers 96
4.3 HTTP 1.1 Request Headers 98
4.4 Sending Compressed Web Pages 104
4.5 Restricting Access to Web Pages 107
viii Contents
© Prentice Hall and Sun Microsystems. Personal use only; do not redistribute.
Chapter 5
Accessing the Standard CGI Variables 114
5.1 Servlet Equivalent of CGI Variables 116
5.2 A Servlet That Shows the CGI Variables 119
Chapter 6
Generating the Server Response: HTTP Status Codes 122
6.1 Specifying Status Codes 124
6.2 HTTP 1.1 Status Codes and Their Purpose 126
6.3 A Front End to Various Search Engines 135
Chapter 7
Generating the Server Response: HTTP Response Headers 142
7.1 Setting Response Headers from Servlets 143
7.2 HTTP 1.1 Response Headers and Their Meaning 145
7.3 Persistent Servlet State and Auto-Reloading Pages 154
7.4 Using Persistent HTTP Connections 163
7.5 Using Servlets to Generate GIF Images 168
Chapter 8
Handling Cookies 178
8.1 Benefits of Cookies 179
Identifying a User During an E-commerce Session 180
Avoiding Username and Password 180
Customizing a Site 180
Focusing Advertising 181
8.2 Some Problems with Cookies 181
8.3 The Servlet Cookie API 183
Creating Cookies 183
Cookie Attributes 183
Placing Cookies in the Response Headers 186
Reading Cookies from the Client 186
8.4 Examples of Setting and Reading Cookies 186
剩余616页未读,继续阅读
资源评论
- huaihuaimao2014-09-21Core Servlets and JavaServer Pages Volume 1-Core Technologies 第一版 英文版。很遗憾,是第一版的,楼主没有标注出来。
zhangzhongfeng
- 粉丝: 1
- 资源: 19
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 功率拓扑快速参考指南-ti,TI官方出品
- 开关电源拓朴图表,各种电路拓扑表格
- 登录和注册 前端:vue3+iview plus +axios 后台:spring boot +mybatis
- 软件测试入门简介:从基础到实践的全面介绍
- 2024CDA Level Ⅰ 认证考试大纲
- YOLO 数据集:淋巴病灶检测(1类别,包含训练集、验证集)
- 基于AT91RM9200处理器+XC3S250E(FPGA)+AD5322采集板Cadence ORCAD(硬件原理图+PCB)
- java+vue2实现zebra打印机,js实现
- J-link烧录软件,用于hex文件烧录
- VB打开时间同步页面/Internet时间设置.vbs
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功