Manning Logo
Home | Ordering Info | Shopping Cart | Manage My Account | Login
Attention customers: online shopping is now available exclusively through our main website: http://www.manning.com. Thank you.
Java Servlets by Example

Inside the book

Sample Chapters Table of Contents Index Preface Book Reviewers Source Code Author Online

Manning Blog

Why small is sweet?

Author Blogs

Dave Crane more...

Author Calendar

Upcoming Events

Catalog

Java .NET Perl XML All by Subject All by Title

About...

Manning Contact Us Ordering FAQs ebooks Covers Sandbox Forums Distributors Manning Early Access Program (MEAP) Affiliate Program Academia/Publicity User Group Program Press Releases Jobs

Manning Publications Co.
209 Bruce Park Avenue
Greenwich, CT 06830

Java Servlets by Example
Alan R. Williamson

1999 | 550 pages
ISBN: 188477766X
$39.95 Softbound print book  

Table of Contents

preface xi
acknowledgments xii
how to use this book xiv
author online xvi
about the cover illustration xvii

1 Introduction 1

    1.1 The world wide web 2
    1.2 Current applications 6
    1.3 Future applications 8
    1.4 Java language 9
    1.5 Java server API 14
    1.6 Java servlet API 14
    1.7 The future of Java and servlets 14
    1.8 Who should read this book? 15

2 Java servlets API 16

    2.1 Servlet introduction 17
    2.2 A day in the life of a servlet 19
    2.3 Servlet security 20
    2.4 Java Servlet Development Kit installation 22
    2.5 Servlet structure 23
    2.6 Web-based servlets 29
    2.7 HttpServlet 29
    2.8 From here 36

3 Java web server 37

    3.1 Installation 38
    3.2 Administration 39
    3.3 Proxy server 57
    3.4 Secure web server 58
    3.5 Core servlets 58

4 Servlet engines 60

    4.1 Test environment 61
    4.2 ServletExec 61
    4.3 Installation 61
    4.4 JRun 68
    4.5 Other servlet engines 75

5 Debugging and optimization techniques 76

    5.1 Debugging 77
    5.2 Optimization 88

6 CGI overview 90

    6.1 What is CGI? 91
    6.2 CGI in operation 92
    6.3 General limitations 96
    6.4 CGI implementation 97
    6.5 Future of CGI 100
    6.6 From here 101

7 HTML page counters 102

    7.1 What is a hit counter? 103
    7.2 Simple counters 105
    7.3 Advanced counters 109
    7.4 Further development 118

8 General HTML utilities 120

    8.1 Navigational forms 121
    8.2 File uploading 123
    8.3 Zip archive retrieval 132
    8.4 HTML template class 134
    8.5 Other application areas 139

9 HTML form processing 140

    9.1 Form introduction 141
    9.2 Basic form processing 144
    9.3 Generic form2email 151
    9.4 Confirmation forms 153
    9.5 Future extensions 159

10 Guest books 160

    10.1 What is a guest book? 161
    10.2 A simple guest book servlet 162
    10.3 Email class 167
    10.4 HTML removal 171
    10.5 Other application areas 172
    10.6 From here 173

11 Newsgroups 174

    11.1 What is a newsgroup? 175
    11.2 Implementing a newsgroup 177
    11.3 Complete source code 194
    11.4 Future extensions 198

12 Quote generator 199

    12.1 Simple quote generator 200
    12.2 Advanced quote generater 204
    12.3 Random quote generater 205
    12.4 Handling much larger data sets 206
    12.5 Possible alternative uses for the quote generator 210
    12.6 From here 210

13 Random links 211

    13.1 What is a random link? 212
    13.2 Random link administration 216
    13.3 Complete source code 219
    13.4 Future extensions 221
    13.5 From here 222

14 Dynamic images 223

    14.1 Serving images 224
    14.2 Server-side push 228
    14.3 Future extensions 230

15 HTML filters 231

    15.1 HTML filters 232
    15.2 Search and destroy 233
    15.3 Search and replace 240
    15.3 Future extensions 243

16 Autolinks 244

    16.1 Glossary definition 245
    16.2 System overview 246
    16.3 Linking the keywords 249
    16.4 Complete source code 257
    16.5 Future extensions 261
    16.6 From here 262

17 Link validation 263

    17.1 Introduction to web crawlers 264
    17.2 Performance issues 283
    17.3 Future extensions 283

18 Search engine 285

    18.1 Search engines overview 286
    18.2 Search logistics 288
    18.3 Global search servlet 290
    18.4 Local search servlet 303
    18.5 Summary and possible enhancements 309

19 Client-side data 311

    19.1 Cookies 312
    19.2 Future extensions 324

20 Online games 325

    20.1 Slot machine 326
    20.2 Spinning the wheels 328
    20.3 Roulette 331
    20.4 Future extensions 350

21 Banner advertising 351

    21.1 Introduction to banner advertising 352
    21.2 Real estate: selling space 354
    21.3 From here 375

22 Email fortune cookies 376

    22.1 Mailing list servlet 377
    22.2 Fortune cookie servlet 387
    22.3 Future extensions 403

23 Online shopping 404

    23.1 Introduction 405
    23.2 Virtual store structure 407
    23.3 Virtual shopping basket 409
    23.4 The checkout 414
    23.5 Making payment 417
    23.6 Future extensions 418

24 Servlets and JDBC 419

    24.1 JDBC overview 420
    24.2 Method #1: connection per client 424
    24.3 Method #2: connection pool 428
    24.4 Future extensions 438

25 Internet chats 439

    25.1 Chat introduction 440
    25.2 Applet-based chat 447
    25.3 Performance 467
    25.4 Future extensions 468

26 Servlets and RMI 470

    26.1 RMI overview 471
    26.2 Servlets and RMI 477
    26.3 Summary 480

27 Servlet-to-servlet communication 481

    27.1 Common base class 482
    27.2 Summary 489
appendix A 490

appendix B 537

appendix C 539

index 542

DESCRIPTION

Although CGI scripts provide 80% of today's server side processing, they are slow, inefficient, and memory-hungry. A new species is evolving to take their place, one which is lean, fast, portable, and easy to maintain: Java servlets.

Servlets are not merely an alternative to CGI, for they can do much more. Servlets have opened the door to a world of client/server applications that would have been too difficult or too time-consuming to consider before.

Java Servlets: By Example takes the reader into the world of servlets, moving example by example from the simple to the complex. An early chapter explains the simple HTML form processing through servlets. A later chapter shows how to connect a Java applet to a servlet, which is itself connected to a database.

Java Servlets: By Example is full of real-world, ready-to-run example code. Each chapter deals with a new problem and takes the reader through a series of servlet-based solutions. However, the book is detailed enough that it may also serve as a reference for the developer.

Translation rights for Java Servlets by Example have been granted for China and India. If you are interested in learning where to buy this book in a language other than English, please inquire at your local bookseller.

WHAT THE EXPERTS SAY ABOUT THIS BOOK...

"Alan Williamson has done an admirable job of teaching servlet programming through useful, typically non-trivial examples that demonstrate real-world solutions to common problems. If you plan to work with servlets (or already work with them) Java Servlets By Example will help you hone your craft and allow you to draw on some good ideas in the process.

The layered unveiling of concepts, clear explanations, and effective communication make Java Servlets By Example an excellent choice for novice or expert servlet developers alike. The examples are numerous and pragmatic, providing a practical look at the development process and exploring potentially useful foundations you can take and apply in a real commercial solution. In all, this book delivers on the promise of teaching servlet programming by example and represents a fine investment for almost any Java programmer."
--Claude Duguay, DevX.com

"Comprehensive description of everything to do with developer Java servlets. Servlets is a new topic for most developers, and this book covers everything they need to know to get started developing, and then covers more advanced topics. It has plenty of sample code to illustrate the concepts."
--Clipcode.com

WHAT THE READERS SAY ABOUT THIS BOOK...

"…I put this book to the ultimate test. I needed to learn servlets very fast for a client and it succeeded…"
--Billy Barron, Delphi Consultants, reviewed at JavaMUG

ABOUT THE AUTHOR...

Alan Williamson is based in the United Kingdom, where he runs his own Java software company, N-ARY Limited. He was educated at the University of Paisley and has worked for several international companies. He writes a regular column for the Java Developers Journal and sits on the judging panel of JARS, the online Java applet rating service.

Home | Catalog | Privacy Policy | About Manning

© 2003-2006 Manning Publications Co.