Synopses & Reviews
JavaServer Pages (JSP) technology provides an easy way to create dynamic web pages. JSP uses a component-based approach that allows web developers to easily combine static HTML for look-and-feel with Java components for dynamic features. The simplicity of this component-based model, combined with the cross-platform power of Java, allows a web development environment with enormous potential.JavaServer Pages shows how to develop Java-based web applications without having to be a hardcore programmer. The author provides an overview of JSP concepts and discusses how JSP fits into the larger picture of web applications. Web page authors will benefit from the chapters on generating dynamic content, handling session information, accessing databases, authenticating users, and personalizing content. In the programming-oriented chapters, Java programmers learn how to create Java components and custom JSP tags for web authors to use in JSP pages.
JavaServer Pages (JSP) is an easy way to create dynamic Web pages and simplify the task of building Web applications that work with a wide variety of Web servers, application servers, browsers, and development tools. This book provides an overview of JSP concepts, discusses how JSP fits into the larger picture of Web applications, and tells how to set up the JSP environment, generate dynamic content, and handle errors.
About the Author
Hans Bergsten is the founder of Gefion Software, a company focused on Java services and products based on the J2EE technlogies. Hans has been an active participant in the working groups for both the servlet and JSP specifications from the time they were formed. He also contributes to other related JCP specifications, such as JSP Standard Tag Libraries (JSTL), and helped get the development of the Apache Tomcat reference implementation for servlet and JSP started as one of the initial members of the Apache Jakarta Project Management Committee.
Table of Contents
Preface; What's in This Book; Audience; Organization; About the Examples; Conventions Used in This Book; How to Contact Us; Acknowledgments; JSP Application Basics; Chapter 1: Introducing JavaServer Pages; 1.1 What Is JavaServer Pages?; 1.2 Why Use JSP?; 1.3 What You Need to Get Started; Chapter 2: HTTP and Servlet Basics; 2.1 The HTTP Request/Response Model; 2.2 Servlets; 2.3 Packaging Java Web Applications; Chapter 3: JSP Overview; 3.1 The Problem with Servlets; 3.2 The Anatomy of a JSP Page; 3.3 JSP Processing; 3.4 JSP Application Design with MVC; Chapter 4: Setting Up the JSP Environment; 4.1 Installing the Java Software Development Kit; 4.2 Installing the Tomcat Server; 4.3 Testing Tomcat; 4.4 Installing the Book Examples; 4.5 Example Web Application Overview; JSP Application Development; Chapter 5: Generating Dynamic Content; 5.1 What Time Is It?; 5.2 Input and Output; Chapter 6: Using Scripting Elements; 6.1 Java Primer; 6.2 Implicit JSP Objects; 6.3 Conditional Processing; 6.4 Displaying Values; 6.5 Using an Expression to Set an Attribute; 6.6 Declaring Variables and Methods; Chapter 7: Error Handling and Debugging; 7.1 Dealing with Syntax Errors; 7.2 Debugging a JSP-Based Application; 7.3 Dealing with Runtime Errors; Chapter 8: Sharing Data Between JSP Pages, Requests, and Users; 8.1 Passing Control and Data Between Pages; 8.2 Sharing Session and Application Data; 8.3 Using Custom Actions; 8.4 Online Shopping; 8.5 Memory Usage Considerations; Chapter 9: Database Access; 9.1 Accessing a Database from a JSP Page; 9.2 Input Validation Without a Bean; 9.3 Using Transactions; 9.4 Application-Specific Database Actions; Chapter 10: Authentication and Personalization; 10.1 Container-Provided Authentication; 10.2 Application-Controlled Authentication; 10.3 Other Security Concerns; Chapter 11: Internationalization; 11.1 How Java Supports Internationalization and Localization; 11.2 Generating Localized Output; 11.3 A Brief History of Bits; 11.4 Handling Localized Input; Chapter 12: Bits and Pieces; 12.1 Buffering; 12.2 Including Page Fragments; 12.3 XML and JSP; 12.4 Mixing Client-Side and Server-Side Code; 12.5 Precompiling JSP Pages; 12.6 Preventing Caching of JSP Pages; 12.7 How URLs Are Interpreted; JSP in J2EE and JSP Component Development; Chapter 13: Web Application Models; 13.1 The Java 2 Enterprise Edition Model; 13.2 The MVC Model; 13.3 Scalability; Chapter 14: Combining Servlets and JSP; 14.1 Using a Servlet as the Controller; 14.2 A More Modular Design Using Action Objects; 14.3 Sharing Data Between Servlets and JSP Pages; 14.4 Using a JSP Error Page for All Runtime Errors; Chapter 15: Developing JavaBeans for JSP; 15.1 JavaBeans as JSP Components; 15.2 JSP Bean Examples; 15.3 Unexpected Behavior; Chapter 16: Developing JSP Custom Actions; 16.1 Tag Extension Basics; 16.2 Developing a Simple Action; 16.3 Processing the Action Body; 16.4 Letting Actions Cooperate; 16.5 Creating New Variables Through Actions; 16.6 Developing an Iterating Action; 16.7 Creating the Tag Library Descriptor; 16.8 Validating Syntax; 16.9 How Tag Handlers May Be Reused; 16.10 Packaging and Installing a Tag Library; Chapter 17: Developing Database Access Components; 17.1 Using Connections and Connection Pools; 17.2 Using a Generic Database Bean; 17.3 Developing Generic Database Custom Actions; 17.4 Developing Application-Specific Database Components; Appendixes; JSP Elements Syntax Reference; Directive Elements; Scripting Elements; Action Elements; Comments; Escape Characters; JSP API Reference; Implicit Variables; Servlet Classes Accessible Through Implicit Variables; Tag Extension Classes; Other JSP Classes; Book Example Custom Actions and Classes Reference; Generic Custom Actions; Internationalization Custom Actions; Database Custom Actions; Utility Classes; Database Access Classes; Web-Application Structure and Deployment Descriptor Reference; Web Application File Structure; Web Application Deployment Descriptor; Creating a WAR File; JSP Resource Reference; JSP-Related Products; Web Hosting; Information and Specifications; Colophon;