Book description
JSP is one of the core technologies for server-side Java applications and the 2.0 release, which this book covers in detail, makes JSP an even more powerful tool
Walks Java programmers and Web developers through JSP fundamentals, including JSP syntax and directives, JSP Expression Language, JSP Tag libraries, JSTL, and techniques for testing and debugging
Shows how to use JSP in real-world Web applications along with open source frameworks such as Struts, WebWork, and Turbine, software design methodologies, and developer tools like Ant, jUnit, and CVS, as well as popular IDEs (integrated development environmnents)
Each chapter has an exercise section with solutions on the companion Web site
Table of contents
- Copyright
- About the Authors
- Credits
- Acknowledgments
- Introduction
-
I. JSP Fundamentals
-
1. Getting Started with JavaServer Pages
-
1.1. Creating Applications for the Internet
- 1.1.1. Limitations of the basic Web server model
- 1.1.2. Dynamic HTML generation via CGI
- 1.1.3. Shortcomings of CGI
- 1.1.4. Improving Java-based CGI: servlets
- 1.2. Summary
- 1.3. Exercises
-
1.1. Creating Applications for the Internet
-
2. JSP Basics 1: Dynamic Page Creation for Data Presentation
- 2.1. The Anatomy of a JSP Page
- 2.2. Summary
- 2.3. Exercises
-
3. JSP Basics 2: Generalized Templating and Server Scripting
- 3.1. Scripting Elements for Java Code Embedding
- 3.2. Creating a Simple Web Storefront
- 3.3. Adding a Shopping Cart to a Catalog
- 3.4. Creating the Shopping Cart
- 3.5. Summary
- 3.6. Exercises
- 4. CSS, JavaScript, VBScript, and JSP
-
5. JSP and EL
- 5.1. EL and Its Vital Role in JSP
- 5.2. EL Named Variables
- 5.3. Applying EL
- 5.4. Coercion: Automatic Type Conversion
- 5.5. Accessing Object Properties and Collections
- 5.6. Implicit EL Objects in JSP 2.0
- 5.7. User-Supplied Functions within EL
- 5.8. Summary
- 5.9. Exercises
-
6. JSP Tag Libraries and JSTL
- 6.1. The Vital Role of JSP Tag Libraries
- 6.2. The JSP Standard Tag Library
- 6.3. Anatomy of a Tag Library
- 6.4. Summary
- 6.5. Exercises
-
7. JSP Directives
- 7.1. Directive Basics
- 7.2. The page Directive
- 7.3. The taglib Directive
- 7.4. The include Directive
- 7.5. Summary
- 7.6. Exercises
-
8. JSP Standard Actions
- 8.1. JSP Standard Actions Are Built-in Tags
-
8.2. Actions for Working with JavaBeans
-
8.2.1. The <jsp:useBean> standard action
- 8.2.1.1. Using the <jsp:useBean> standard action
-
8.2.1.2. How It Works
- 8.2.1.2.1. Searching for a scoped named attribute
- 8.2.1.2.2. Container-generated Java source code
- 8.2.1.2.3. Synchronizing a Java reference with an attached attribute
- 8.2.1.2.4. Using a JavaBean in scripting elements
- 8.2.1.2.5. Using a JavaBean in an EL expression
- 8.2.1.2.6. Effect of the type attribute in <jsp:useBean>
- 8.2.1.3. The <jsp:setProperty> standard action
- 8.2.1.4. How It Works
- 8.2.2. How <jsp:useBean> and JSTL <c:set> Differ
-
8.2.1. The <jsp:useBean> standard action
- 8.3. Including JSP Output via <jsp:include>
- 8.4. Transferring Control Between JSPs
- 8.5. Specifying Parameters for Other Actions
-
8.6. Working with Plug-ins
- 8.6.1. The <jsp:plugin> standard action
- 8.6.2. The <jsp:params> standard action
-
8.6.3. The <jsp:fallback> standard action
-
8.6.3.1. How It Works
- 8.6.3.1.1. Generating parameters for the applet
- 8.6.3.1.2. Handling user color selection
- 8.6.3.1.3. Processing the color parameter
- 8.6.3.1.4. Rendering alternative output for browsers without applet support
- 8.6.3.1.5. HTML generated by <jsp:plugin>
- 8.6.3.1.6. Practical real-world use of <jsp:plugin>
-
8.6.3.1. How It Works
- 8.7. Standard Actions Specific to Tag Files
- 8.8. Summary
- 8.9. Exercises
-
9. JSP and JavaBeans
-
9.1. Anatomy of a JavaBean
- 9.1.1. JavaBean Properties
- 9.1.2. JavaBean methods
-
9.1.3. Common JavaBean packaging
-
9.1.3.1. How It Works
- 9.1.3.1.1. Switching requests through a front controller
- 9.1.3.1.2. The index.jsp front controller
- 9.1.3.1.3. Forwarding to different targets
- 9.1.3.1.4. JavaBean flow for validation error reporting
- 9.1.3.1.5. Accessing JavaBeans using standard actions
- 9.1.3.1.6. The validation error information JavaBean
- 9.1.3.1.7. The enterbid.jsp target
- 9.1.3.1.8. Displaying bid information via a JavaBean
- 9.1.3.1.9. Formatting auction output pages with a CSS stylesheet
- 9.1.3.2. How It Works
-
9.1.3.1. How It Works
- 9.2. How JavaBeans and EJBs Differ
- 9.3. Summary
- 9.4. Exercises
-
9.1. Anatomy of a JavaBean
-
10. Error Handling
- 10.1. Understanding the Origin of Errors
- 10.2. Summary
- 10.3. Exercises
-
11. Building Your Own Custom JSP Tag Library
- 11.1. What Is a Tag File?
- 11.2. A Simple Tag File: Displaying Today's Date
- 11.3. Advantages of Tag Files
- 11.4. Developing Tag Files
- 11.5. Packaging Tag Files
- 11.6. Summary
- 11.7. Exercises
-
12. Advanced Dynamic Web Content Generation
-
12.1. Data Validation in Web Applications
- 12.1.1. Server-side validation and efficient usage of resources
- 12.1.2. Client-side data validation
- 12.1.3. The need for server-side validation
- 12.1.4. Common client-side validation scenarios
- 12.1.5. Operation of client-side validation
- 12.1.6. Dynamic generation of client-side JavaScript code
- 12.1.7. Dynamic generation of XML using JSP
- 12.2. Summary
- 12.3. Exercises
-
12.1. Data Validation in Web Applications
-
13. Internationalization and Localized Content
- 13.1. About Internationalization-Ready Applications
- 13.2. Internationalization and Localization
-
13.3. Building on the Java Platform's i18n Capabilities
- 13.3.1. The concept of a locale
-
13.3.2. Maintaining locale information
- 13.3.2.1.
-
13.3.2.2. How It Works
- 13.3.2.2.1. Explicit user selection of locale
- 13.3.2.2.2. Linking to the English form
- 13.3.2.2.3. Linking to the Chinese form
- 13.3.2.2.4. Handling i18n using duplicated sets of translated pages
- 13.3.2.2.5. The localized English pages
- 13.3.2.2.6. The localized Chinese pages
- 13.3.2.2.7. Trying out the English pages
- 13.3.2.2.8. Trying out the Chinese localization
- 13.3.2.3. How It Works
- 13.3.2.4. Java 2 resource bundles
- 13.3.2.5. Creating a resource bundle
- 13.3.2.6. How Java 2 selects i18n strings
- 13.3.2.7. Creating the Chinese l10n properties file
- 13.3.2.8. The Locale selection page
- 13.3.2.9. Generating a localized form using JSP
- 13.3.2.10. JSTL tags that support i18n
- 13.3.2.11. Applying the JSTL i18n tags
- 13.3.2.12. Creating an i18n-ready form processing JSP
- 13.3.2.13. Setting request parameter encoding
- 13.3.2.14. Determining a user's locale automatically (almost!)
- 13.3.2.15. How It Works
- 13.3.2.16. How It Works
- 13.4. Summary
- 13.5. Exercises
-
14. JSP Debugging Techniques
- 14.1. The Science of Debugging
- 14.2. Catching Bugs at Compile Time
- 14.3. Using a Debugging System versus a Production System
- 14.4. Using System.out.println() to Instrument Code
- 14.5. Using a Logging System
- 14.6. Debugging with Tools
- 14.7. Debugging Code in Production Environments
- 14.8. Finding the Intermittent Problem
- 14.9. Avoiding Concurrency Issues
- 14.10. Summary
- 14.11. Exercises
-
1. Getting Started with JavaServer Pages
-
II. JSP and Modern Web Server Software Development
-
15. JSPs and Servlets
-
15.1. A JSP Is a Servlet
- 15.1.1.
-
15.1.2. Anatomy of a servlet
- 15.1.2.1. The mark of a servlet: the javax.servlet.Servlet interface
- 15.1.2.2. Implementing the Servlet interface through the helper HttpServlet class
- 15.1.2.3. Overriding methods that you want to implement
- 15.1.2.4. Delegating processing to a common helper method
- 15.1.2.5. The init() and destroy() methods
- 15.1.3. The lifecycle of a servlet
- 15.1.4. Describing servlets to containers in the deployment descriptor
- 15.1.5. The servlet declaration
- 15.1.6. Using servlets when JSP is available
- 15.1.7. Specifying initialization parameters
- 15.1.8. Accessing initialization parameters within the ControllerServlet
- 15.1.9. Custom forwarding of incoming requests via the controller servlet
- 15.1.10. The forwarding targets
- 15.2. Summary
- 15.3. Exercises
-
15.1. A JSP Is a Servlet
-
16. The Role of JSP in the Wider Context: Web Applications
- 16.1. What Is a Web Application?
- 16.2. Directory Structure for a Web Application
- 16.3. The Deployment Descriptor
- 16.4. Using a Web Archive
- 16.5. Development and Deployment Strategies
- 16.6. Packaging and Deploying for Tomcat
- 16.7. Summary
- 16.8. Exercises
- 17. Model View Controller
-
18. Web Frameworks
- 18.1. What Is a Framework?
- 18.2. Why Frameworks Are Good
- 18.3. Types of Frameworks
- 18.4. WebWork
- 18.5. The Spring Framework
- 18.6. Summary
- 18.7. Exercises
- 19. Struts Framework
- 20. Layout Management with Tiles
- 21. JavaServer Faces
- 22. JSP in J2EE
-
23. Access to Databases
-
23.1. Introduction to Databases
- 23.1.1. Connecting to a database
- 23.1.2. Downloading and Installing MySQL
- 23.1.3. JDBC APIs
- 23.2. Building Applications
- 23.3. Different Types of Applications
- 23.4. Using Hibernate
- 23.5. Summary
-
23.1. Introduction to Databases
- 24. Security
-
25. Performance
- 25.1. Performance Concepts
- 25.2. Measuring Performance Using JMeter
-
25.3. Performance Tuning Tips
-
25.3.1. Development-time measures
- 25.3.1.1. Avoid creating sessions for JSPs if not required
- 25.3.1.2. Session objects should be small in size
- 25.3.1.3. Time out sessions quickly
- 25.3.1.4. Use the right scope for objects
- 25.3.1.5. Use connection pooling for performance
- 25.3.1.6. Cache data
- 25.3.1.7. Use transfer objects
- 25.3.1.8. Minimize logging
- 25.3.2. Deployment-time measures
-
25.3.1. Development-time measures
- 25.4. Summary
- 26. Best Practices and Tools
-
15. JSPs and Servlets
-
III. Spreading Your New Wings: Applying JSP in the Real World
- 27. JSP Project I: Personalized Portal
-
28. JSP Project II: Shopping Cart Application
- 28.1. The Bookstore Project
- 28.2. Application Design
- 28.3. The Development Environment and Its Configuration
- 28.4. The Application
- 28.5. Summary
- 28.6. Exercises
-
IV. Appendixes
-
A. JSP Syntax Reference
- A.1. Scoping
- A.2. Implicit Objects
- A.3. Directives
-
A.4. Actions
-
A.4.1. Standard actions
- A.4.1.1. The <jsp:useBean> action
- A.4.1.2. The <jsp:setProperty> action
- A.4.1.3. The <jsp:getProperty> action
- A.4.1.4. The <jsp:include> action
- A.4.1.5. The <jsp:forward> action
- A.4.1.6. The <jsp:params> action
- A.4.1.7. The <jsp:p aram> action
- A.4.1.8. The <jsp:plugin> action
- A.4.1.9. The <jsp:fallback> action
- A.4.2. Other JSP standard actions
-
A.4.1. Standard actions
- A.5. Scripting Elements
-
B. JSP Expression Language Reference
- B.1. EL Expressions
- B.2. Accessing Arrays, Maps, Object Properties, and Collections
- B.3. Elements of EL Expressions
- B.4. Type Conversions
-
B.5. Implicit Objects
- B.5.1. The pageContext implicit object
- B.5.2. The pageScope implicit object
- B.5.3. The requestScope implicit object
- B.5.4. The sessionScope implicit object
- B.5.5. The applicationScope implicit object
- B.5.6. The param implicit object
- B.5.7. The paramValues implicit object
- B.5.8. The header implicit object
- B.5.9. The headerValues implicit object
- B.5.10. The cookies implicit object
- B.5.11. The initParam implicit object
- C. JSTL Reference
-
D. Exercise Solutions
- D.1. Chapter 1 Exercises
- D.2. Chapter 2 Exercises
- D.3. Chapter 3 Exercises
- D.4. Chapter 4 Exercises
- D.5. Chapter 5 Exercises
- D.6. Chapter 6 Exercises
- D.7. Chapter 7 Exercises
- D.8. Chapter 8 Exercises
- D.9. Chapter 9 Exercises
- D.10. Chapter 10 Exercises
- D.11. Chapter 11 Exercises
- D.12. Chapter 12 Exercises
- D.13. Chapter 13 Exercises
- D.14. Chapter 14 Exercises
- D.15. Chapter 15 Exercises
- D.16. Chapter 16 Exercises
- D.17. Chapter 17 Exercises
- D.18. Chapter 18 Exercises
- D.19. Chapter 19 Exercises
- D.20. Chapter 20 Exercises
- D.21. Chapter 21 Exercises
- D.22. Chapter 22 Exercises
- D.23. Chapter 24 Exercises
- D.24. Chapter 26 Exercises
- D.25. Chapter 27 Exercises
- D.26. Chapter 28 Exercises
-
A. JSP Syntax Reference
Product information
- Title: Beginning JavaServer Pages™
- Author(s):
- Release date: February 2005
- Publisher(s): Wrox
- ISBN: 9780764574856
You might also like
book
Advanced JavaServer Pages™
Design and implement flexible, extensible, and maintainable applications with servlets and JSP technology Master powerful authentication …
book
JavaServer Pages, Second Edition
Since its inception in 1999, Enterprise Java has taken the Java programming community by storm--developers have …
book
JavaServer Pages, 3rd Edition
JavaServer Pages (JSP) has built a huge following since the release of JSP 1.0 in 1999, …
book
J2EE™ Tutorial, The
You're familiar with Java™ programming, but now it's time for you to take it to the …