Enterprise Java Servlets

Enterprise Java Servlets

3.5 2
by Jeff M. Genender

ISBN-10: 020170921X

ISBN-13: 9780201709216

Pub. Date: 09/04/2001

Publisher: Pearson Education

Learn to design and build a base enterprise servlet. Create an architecture that makes your enterprise applications run faster and more reliably.

Java™ servlets are rapidly replacing CGI as the tool of choice for creating interactive applications for the enterprise market. Using the Java programming language's servlet technology

…  See more details below


Learn to design and build a base enterprise servlet. Create an architecture that makes your enterprise applications run faster and more reliably.

Java™ servlets are rapidly replacing CGI as the tool of choice for creating interactive applications for the enterprise market. Using the Java programming language's servlet technology speeds up the application development process, freeing developers from the need to make platform-specific modifications. Servlet technology is reliable, employs reusable components, and ensures high performance in the demanding enterprise and e-commerce markets.

Enterprise Java™ Servlets anticipates common issues and provides new development methods, extensive sample code, and case studies. The book is based on a battle-tested base servlet architecture that the author and his team created while repairing a workflow application for clients. Jeff noticed that many corporations and development shops ran into the same problems and pitfalls time and time again. This book chronicles Jeff's experiences creating a servlet-based architecture, which helps avoid issues that are continually encountered and provides for rapid application development in the enterprise. The type of architecture presented here eliminates the need to code servlets from scratch and automatically provides each servlet with access to all the new features and solutions added to the base servlet. This type of single-servlet approach results in a single, consistent application that is easy to migrate to production and extend to new applications.

You'll find expert coverage of various topics,including:

  • HTML development in servlets
  • How templates assist in content management
  • Pool objects that streamline the use of objects and database connections in a Web environment
  • Integrating LDAP into a Java servlet application
  • Dynamic image generation and pluggable security models for servlets
  • Multiple applications running on a single server and the effect on session, component, and application variables

Geared to developers who have a working knowledge of servlet development, this book provides the base servlet architecture—complete with extensive code samples and numerous case studies—that you can build on when writing enterprise applications. Using base servlet architecture removes the drudgery of developing servlets, so you can concentrate on business needs.

The accompanying CD-ROM includes code examples, as well as Windows and UNIX versions of JRun, ServletExec, and Apache Tomcat Servlet Container.

Read More

Product Details

Pearson Education
Publication date:
Edition description:
Product dimensions:
7.36(w) x 9.25(h) x 0.35(d)

Table of Contents

Chapter 1Introduction to Enterprise Servlets1
Developing Servlets and Servlet Containers2
Setting Up and Running Servlets3
Registering Servlets with the Servlet Container4
What You Need6
The Base Enterprise Servlet7
The Single-Servlet Approach14
Base Enterprise Servlet Basics14
Implementation of a Base Servlet18
The Class.forName() Method24
The Http Method Class31
The ConfFile Class32
The MethodList Class34
Sample Application35
Chapter 2AppContext: Managing Applications39
The Configuration File Revisited41
The AppContext Object42
Restructuring BaseEnterpriseServlet49
A Two-Application Example56
Forcing Uniqueness across Applications: AppManager63
Chapter 3Forms, State, and Session Management71
HTTP Forms: A Review72
The [left angle bracket]FORM[right angle bracket] Tag72
Packaging the Query with GET and POST75
HTTP Forms and Enterprise Servlets77
Form and HTML Development in the Enterprise79
Maintaining State with Sessions in the Enterprise86
Standard Servlet Architecture and Sessions90
The Enterprise Session93
Session and Form Example with Multiple Applications103
Chapter 4HTML with Templates117
Using Templates118
JSP as a Template Engine119
Developing a Template Engine120
The HTMLTemplate Object126
Templates with Enterprise Servlets134
Nesting Templates136
Making the Template Engine Scream: Caching Templates143
Building the Template Cache146
Integrating the Template Objects and Cache into Enterprise Servlets157
Using the Template Cache in Enterprise Servlets163
Chapter 5Logging and Error Handling169
Logging in a Servlet Engine169
Anomalies of a Servlet Engine Log File171
Components of a Standardized Log File172
The EnterpriseLog Object175
Logging in Enterprise Servlets188
A Logging Example195
Error Handling201
The DefaultErrorHandler Object204
The Logger Application with Error Handling208
Chapter 6Security213
Types of Security213
Web Authentication216
Under the Hood218
Customizing Web Authentication220
An Example Using Pluggable Security Components223
Form-Based Authentication228
Integrating Form-Based Authentication into Enterprise Servlets230
Chapter 7Pools239
What Is a Pool?240
Using Pools in Web Development242
The Base Pool Object244
Using the Pool Object253
Using the Pool: An Example255
The Pool Anomaly259
PoolList and PoolObjectManager262
Using PoolList and PoolObjectManager: An Example269
Chapter 8Database Connectivity273
JDBC: a Quick Review273
Loading the Driver and Connecting to the Database274
The JDBC Statement and Result Set Objects275
The PreparedStatement and CallableStatement Objects276
Closing the Connection278
Managing the Connection in a Server Environment278
Understanding Connection Management281
Building Connection Management284
The JDBCManager Object284
The SQLCursor Object287
The DBConnection Object293
Using the Connection Management Objects294
Database Pooling with the Connection Management Objects297
Using the DBConnectionPool Object300
Making the DBConnectionPool Object Easier to Create304
The Name ValuePair Object306
The DBPoolParser Object307
Using DBPoolParser in Enterprise Servlets313
Chapter 9LDAP Connectivity317
A Little History of LDAP318
How LDAP Works318
Distinguished Names320
Advantages and Disadvantages of LDAP320
LDAP with Java: The JNDI321
Connecting to LDAP321
Searching LDAP for Values322
Sorting Results325
Adding and Removing an Entry325
Modifying Attributes within an Entry327
Closing the LdapContext Object327
LDAP Considerations in a Server Application327
Building the LDAP Connection Management Objects329
The LDAPManager Object330
The LDAPConnection Object337
Using the LDAP Connection Management Objects338
The LDAPConnectionPool Object340
Putting the Connection Management Objects to Use343
Chapter 10Dynamic Graphics351
How a Browser Requests Images352
Handling Image Types354
Dynamic Images355
Memory Management360
Creating Objects Is Your Worst Enemy361
Pooling Memory Buffers361
Random Pie Chart Example364
Chapter 11Using JSP with Enterprise Servlets375
Is There a Preference?375
JSPs with Servlets376
JSPs and Enterprise Servlets384
Releasing BaseEnterpriseServlet's Grip on AppContext385
Tapping into Enterprise Servlets388
A Quick Look at the Java Tag Library389
Bridging JSPs to Enterprise Servlets395
Using the ESBridge Tag Library404
Accessing the EnterpriseSession Object408
Using the [left angle bracket]ESSession[right angle bracket] Tag413
Handling Errors415
Chapter 12Taking Enterprise Servlets Further419
Web Server Startup in a Multiapplication Environment419
Enhancements for the Reader428
The Template Engine428
Database and LDAP Pools428
An Administrative Tool429
A Pager or E-Mail Monitor429
Anything You Want429

Read More

Customer Reviews

Average Review:

Write a Review

and post it to your social network


Most Helpful Customer Reviews

See all customer reviews >

Enterprise Java Servlets 3.5 out of 5 based on 0 ratings. 2 reviews.
Guest More than 1 year ago
The book is a great 'tricks and traps' of servlet development. Shows all kinds of techniques for writing servlets. I highly recommend it for developers who need to understand some of the intricacies of servlet development. Its required reading for my team.
Guest More than 1 year ago
Just putting the word 'Enterprise' on a book cover doesn't make this an 'Enterprise-ready' book. The author fails to learn from the lessons of true Enterprise systems (COBOL, for example) where UI and data elements became tightly bound. Those who fail to capitalize on declarative user interface models are bound to repeat these mistakes. And the author is furthering the foundation required to repeat these mistakes in Java.