
Enterprise Java Servlets
by Jeff M. GenenderISBN-10: 020170921X
ISBN-13: 9780201709216
Pub. Date: 09/04/2001
Publisher: Pearson Education
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
/p>/i>Overview
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 architecturecomplete with extensive code samples and numerous case studiesthat 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.
Product Details
- ISBN-13:
- 9780201709216
- Publisher:
- Pearson Education
- Publication date:
- 09/04/2001
- Edition description:
- BK&CD-ROM
- Pages:
- 464
- Product dimensions:
- 7.36(w) x 9.25(h) x 0.35(d)
Table of Contents
Preface | xiii | |
Chapter 1 | Introduction to Enterprise Servlets | 1 |
Developing Servlets and Servlet Containers | 2 | |
Setting Up and Running Servlets | 3 | |
Registering Servlets with the Servlet Container | 4 | |
What You Need | 6 | |
The Base Enterprise Servlet | 7 | |
The Single-Servlet Approach | 14 | |
Base Enterprise Servlet Basics | 14 | |
Implementation of a Base Servlet | 18 | |
The Class.forName() Method | 24 | |
The Http Method Class | 31 | |
The ConfFile Class | 32 | |
The MethodList Class | 34 | |
Sample Application | 35 | |
Summary | 37 | |
Chapter 2 | AppContext: Managing Applications | 39 |
The Configuration File Revisited | 41 | |
The AppContext Object | 42 | |
Restructuring BaseEnterpriseServlet | 49 | |
A Two-Application Example | 56 | |
Forcing Uniqueness across Applications: AppManager | 63 | |
Summary | 69 | |
Chapter 3 | Forms, State, and Session Management | 71 |
HTTP Forms: A Review | 72 | |
The [left angle bracket]FORM[right angle bracket] Tag | 72 | |
Packaging the Query with GET and POST | 75 | |
HTTP Forms and Enterprise Servlets | 77 | |
Form and HTML Development in the Enterprise | 79 | |
Maintaining State with Sessions in the Enterprise | 86 | |
Standard Servlet Architecture and Sessions | 90 | |
The Enterprise Session | 93 | |
Session and Form Example with Multiple Applications | 103 | |
Summary | 114 | |
Chapter 4 | HTML with Templates | 117 |
Using Templates | 118 | |
JSP as a Template Engine | 119 | |
Developing a Template Engine | 120 | |
The HTMLTemplate Object | 126 | |
Templates with Enterprise Servlets | 134 | |
Nesting Templates | 136 | |
Making the Template Engine Scream: Caching Templates | 143 | |
Building the Template Cache | 146 | |
Integrating the Template Objects and Cache into Enterprise Servlets | 157 | |
Using the Template Cache in Enterprise Servlets | 163 | |
Summary | 166 | |
Chapter 5 | Logging and Error Handling | 169 |
Logging in a Servlet Engine | 169 | |
Anomalies of a Servlet Engine Log File | 171 | |
Components of a Standardized Log File | 172 | |
The EnterpriseLog Object | 175 | |
Logging in Enterprise Servlets | 188 | |
A Logging Example | 195 | |
Error Handling | 201 | |
The DefaultErrorHandler Object | 204 | |
The Logger Application with Error Handling | 208 | |
Summary | 210 | |
Chapter 6 | Security | 213 |
Types of Security | 213 | |
Web Authentication | 216 | |
Under the Hood | 218 | |
Customizing Web Authentication | 220 | |
An Example Using Pluggable Security Components | 223 | |
Form-Based Authentication | 228 | |
Integrating Form-Based Authentication into Enterprise Servlets | 230 | |
Summary | 236 | |
Chapter 7 | Pools | 239 |
What Is a Pool? | 240 | |
Using Pools in Web Development | 242 | |
The Base Pool Object | 244 | |
Using the Pool Object | 253 | |
Using the Pool: An Example | 255 | |
The Pool Anomaly | 259 | |
PoolList and PoolObjectManager | 262 | |
Using PoolList and PoolObjectManager: An Example | 269 | |
Summary | 270 | |
Chapter 8 | Database Connectivity | 273 |
JDBC: a Quick Review | 273 | |
Loading the Driver and Connecting to the Database | 274 | |
The JDBC Statement and Result Set Objects | 275 | |
The PreparedStatement and CallableStatement Objects | 276 | |
Transactions | 277 | |
Closing the Connection | 278 | |
Managing the Connection in a Server Environment | 278 | |
Understanding Connection Management | 281 | |
Building Connection Management | 284 | |
The JDBCManager Object | 284 | |
The SQLCursor Object | 287 | |
The DBConnection Object | 293 | |
Using the Connection Management Objects | 294 | |
Database Pooling with the Connection Management Objects | 297 | |
Using the DBConnectionPool Object | 300 | |
Making the DBConnectionPool Object Easier to Create | 304 | |
The Name ValuePair Object | 306 | |
The DBPoolParser Object | 307 | |
Using DBPoolParser in Enterprise Servlets | 313 | |
Summary | 314 | |
Chapter 9 | LDAP Connectivity | 317 |
A Little History of LDAP | 318 | |
How LDAP Works | 318 | |
Distinguished Names | 320 | |
Advantages and Disadvantages of LDAP | 320 | |
LDAP with Java: The JNDI | 321 | |
Connecting to LDAP | 321 | |
Searching LDAP for Values | 322 | |
Sorting Results | 325 | |
Adding and Removing an Entry | 325 | |
Modifying Attributes within an Entry | 327 | |
Closing the LdapContext Object | 327 | |
LDAP Considerations in a Server Application | 327 | |
Building the LDAP Connection Management Objects | 329 | |
The LDAPManager Object | 330 | |
The LDAPConnection Object | 337 | |
Using the LDAP Connection Management Objects | 338 | |
The LDAPConnectionPool Object | 340 | |
Putting the Connection Management Objects to Use | 343 | |
Summary | 349 | |
Chapter 10 | Dynamic Graphics | 351 |
How a Browser Requests Images | 352 | |
Handling Image Types | 354 | |
Dynamic Images | 355 | |
Memory Management | 360 | |
Creating Objects Is Your Worst Enemy | 361 | |
Pooling Memory Buffers | 361 | |
Random Pie Chart Example | 364 | |
Summary | 373 | |
Chapter 11 | Using JSP with Enterprise Servlets | 375 |
Is There a Preference? | 375 | |
JSPs with Servlets | 376 | |
JSPs and Enterprise Servlets | 384 | |
Releasing BaseEnterpriseServlet's Grip on AppContext | 385 | |
Tapping into Enterprise Servlets | 388 | |
A Quick Look at the Java Tag Library | 389 | |
Bridging JSPs to Enterprise Servlets | 395 | |
Using the ESBridge Tag Library | 404 | |
Accessing the EnterpriseSession Object | 408 | |
Using the [left angle bracket]ESSession[right angle bracket] Tag | 413 | |
Handling Errors | 415 | |
Summary | 417 | |
Chapter 12 | Taking Enterprise Servlets Further | 419 |
Web Server Startup in a Multiapplication Environment | 419 | |
Enhancements for the Reader | 428 | |
The Template Engine | 428 | |
Database and LDAP Pools | 428 | |
An Administrative Tool | 429 | |
A Pager or E-Mail Monitor | 429 | |
Anything You Want | 429 | |
Bibliography | 431 | |
Index | 433 |
Customer Reviews
Average Review:
Most Helpful Customer Reviews
![]() |
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.
|
![]() |
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.
|