Organization

This book is structured into three parts. The first part describes the fundamentals of HTTP (the protocol used by all web applications), how servlets and JSP are related, and how to set up a JSP development environment.

The focus of the second part is on developing JSP-based web applications using both standard JSP elements and custom components. Through practical examples, you will learn how to handle common tasks such as validating user input, accessing databases, authenticating users and protecting web pages, localizing your web site, and more. This portion of the book is geared more towards web content designers.

In the third part, you will learn how to develop your own custom actions and JavaBeans, and how to combine JSP with other Java server-side technologies, such as servlets and Enterprise JavaBeans (EJB). This portion of the book is targeted towards the programming community.

All in all, the book consists of 17 chapters and five appendixes as follows.

Part I, JSP Application Basics

Chapter 1

Explains how JSP fits into the big picture of web applications and how it compares to alternative technologies.

Chapter 2

Describes the fundamental HTTP and servlet concepts you need to know to use JSP to its full potential.

Chapter 3

An overview of the JSP features, as well as the similarities and differences between JSP pages and servlets. Also introduces the Model-View-Controller design model and how it applies to JSP.

Chapter 4

Describes where to get the JSP reference implementation, Apache Tomcat, and how to set it up on your system. Also explains how to install the book examples.

Part II, JSP Application Development

Chapter 5

Explains how to use JSP to generate dynamic content and how to receive and validate user input.

Chapter 6

A brief introduction to Java programming, followed by descriptions of all the JSP elements that let you embed Java code directly in your JSP pages.

Chapter 7

Describes the kinds of errors you may encounter during development of a JSP-based application, and strategies and JSP features that help you deal with them.

Chapter 8

Explains the JSP features that let you separate different types of processing in different pages to simplify maintenance and further development. Also describes how sessions can be used to build up information over a sequence of requests from the same user, and how information that applies to all users can be shared using the application scope.

Chapter 9

A quick overview of relational databases, JDBC, and SQL basics. Introduces a set of generic custom actions for reading, updating, and deleting database data.

Chapter 10

Describes how authentication and access control can be implemented using container-provided and application-controlled mechanisms, and how to use information about the current user to personalize the web pages.

Chapter 11

Explains internationalization and localization, as well as the Java features available to implement an internationalized application. Describes a set of custom actions used to implement a web site with support for multiple languages.

Chapter 12

Covers various areas not discussed in previous chapters, such as using XML and XSL with JSP, combining JSP with client-side code, reusing JSP fragments by including them in JSP pages, precompiling JSP pages, and more.

Part III, JSP in J2EE and JSP Component Development

Chapter 13

An overview of J2EE and web application architectures using JSP in combination with other Java technologies.

Chapter 14

Describes in detail how JSP can be combined with servlets.

Chapter 15

Provides details about JavaBeans as they relate to JSP, including threading and synchronization concerns for session and application-scope JavaBeans, as well as how using JavaBeans can make it easier to eventually migrate to an EJB architecture. The beans used in previous chapters are reused as examples.

Chapter 16

Describes the JSP Tag Extension mechanism and how it is used to develop custom actions, reusing many of the custom actions from previous chapters as examples.

Chapter 17

Describes the database-access custom actions used in the previous chapters and how to use them with both connection pools developed in-house and those provided by a third-party vendor. Also explains how you can reuse the database-access beans to develop your own application-specific database custom actions.

Part IV, Appendixes

Appendix A

Contains descriptions of all the standard JSP 1.1 elements.

Appendix B

Contains descriptions of all implicit objects available in a JSP page as defined by the servlet and JSP APIs, as well as the tag extension mechanism classes and interfaces.

Appendix C

Contains descriptions of the custom actions, beans, and utility classes used in the examples.

Appendix D

Contains descriptions of the standard web-application structure and all elements in the web-application deployment descriptor.

Appendix E

Contains references to JSP-related products, web-hosting services, and sites where you can learn more about JSP and related technologies.

If you’re a page author, I recommend that you focus on the chapters in Part I and Part II. You may want to browse through Part III to get a feel for how things work behind the scenes, but don’t expect to understand everything if you’re not a Java programmer.

If you are a Java programmer, Part III is where the action is. If you’re already familiar with HTTP and servlets, you may want to move quickly through Part I. However, this part does include information about the web application concept introduced in the Servlet 2.2 API that you may not be familiar with, even if you’ve worked with servlets for some time. I recommend that you read Part II to learn how JSP works, but you may want to skip ahead to the chapters in Part III from time to time to see how the components used in the examples are actually implemented.

Get Java Server Pages now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.