Organization

This book is structured into three parts. The first part of the book 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 standard JSP elements, JSTL, and custom components. Through the use of 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 page authors but is also of interest to programmers.

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 intended for the programming community.

All in all, the book consists of 23 chapters and 6 appendixes as follows.

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.

Chapter 5

Examines the JSP basics, such as how to create, deploy, and run a JSP page, as well as how to use the JSP elements to generate dynamic content.

Chapter 6

Describes what a JavaBeans component is and how it can be used effectively in a JSP page.

Chapter 7

Describes what a custom tag library is and how to deploy and use one, and introduces the JSP Standard Tag Library (JSTL) and its powerful Expression Language (EL).

Chapter 8

Explains how an HTML form can be used to send data to a web application and how to process the data using JavaBeans and JSTL, as well what to be aware of when generating dynamic output.

Chapter 9

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 10

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 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 11

Provides a quick overview of relational databases, JDBC, and SQL basics, and introduces the JSTL actions for reading, updating, and deleting database data.

Chapter 12

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

Chapter 13

Explains internationalization and localization, the Java features available to implement an internationalized application, and describes the set of JSTL actions that support development of multilingual web sites.

Chapter 14

Explains how JSP can generate XML content as well as process XML input using the JSTL XML actions.

Chapter 15

Describes the JSP elements that let you embed Java code directly in your JSP pages, and the type of errors you must be prepared to deal with when you use this feature.

Chapter 16

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

Chapter 17

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

Chapter 18

Describes in detail how JSP can be combined with servlets, as well as the listener and filter component types, using the popular Apache Struts framework.

Chapter 19

Provides details about JavaBeans components as they relate to JSP, including threading and synchronization concerns for session and application scope beans, as well as how using JavaBeans components can make it easier to migrate to an EJB architecture.

Chapter 20

Describes the JSP Tag Extension mechanism and how to use it to develop custom tag libraries, using many of the custom actions used in the previous chapters as examples.

Chapter 21

Explains the more advanced features that can be leveraged by custom actions, such as developing cooperating actions, syntax and usage validation, attribute value type conversions, and more.

Chapter 22

Describes all the integration hooks provided by the JSTL specification and how to develop custom actions, servlets, listeners, and filters that take advantage of them.

Chapter 23

Provides a brief introduction to JDBC and explains the various strategies available for efficient use of databases in a web application, such as setting up a connection pool and making it available to the application components through the servlet context or JNDI, encapsulating database access code in separate classes or in custom actions, and more.

Appendix A

Contains descriptions of all standard JSP 1.2 elements.

Appendix B

Contains descriptions of all standard JSTL 1.0 elements, programming interfaces, and support classes.

Appendix C

Contains a description of the JSTL EL syntax and rules.

Appendix D

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 E

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

Appendix F

Contains a description of the standard web application structure and all elements in the web application deployment descriptor.

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 scene but don’t expect to understand everything if you aren’t a Java programmer.

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

Get JavaServer Pages, Second Edition 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.