Book description
Sams Teach Yourself JavaServer Pages in 21 Days offers a proven tutorial format to teach JSP in 21 example-driven lessons. This book is for Web publishing professionals migrating to JavaServer Pages for its ability to create dynamic, interactive Web sites and separate presentation from Java code running behind the scenes. The book starts by explaining the relationship between JSP and Java Servlets and the basics of JSP functions and features. You'll then learn how JSP handles data, interacts with Java components, tracks users, and more. Later chapters discuss debugging, working with databases, XSLT and XML, using the Struts framework from Apache, handling binary data like graphics, and deploying JSP applications. Each topic is illustrated with many working examples that the reader can understand and put to work immediately. Throughout the book the author provides pointers to upcoming developments in JSP 2, to ensure that you are prepared for changes in the new version.
Table of contents
- Copyright
- About the Author
- Acknowledgments
- We Want to Hear from You!
- Introduction
-
1. At a Glance
- 1. Getting Started!
-
2. Handling Data and Operators
- Java in JSP
- The JSP Programming Environment
- Handling Data in JSP
- Creating Variables
- Initializing Variables
- Data Types
- Converting Between Data Types
- Strings
- Creating Strings
- Strings Are Objects
- Determining String Length
- Creating and Working with Arrays
- Working with Operators
- Assignment Operators
- Incrementing and Decrementing Operators
- Multiplication and Division Operators
- Addition and Subtraction Operators
- Relational Operators
- Logical Operators
- Understanding Operator Precedence
- Summary
- Q&A
- Workshop
- 3. Branching, Looping, and Creating Methods
- 4. Reading Data from Web Pages: Buttons and Text Fields
-
5. Reading Data from Web Pages: Check Boxes, Radio Buttons, and Select Controls
- Using Check Boxes
- Using Radio Buttons
- Selecting and Deselecting Check Boxes and Radio Buttons in Code
- Using Select Controls
- Using Multiple-Selection Select Controls
- Check Box Groups
- Uploading Files
- Image Controls
- Using <jsp:forward>
- Creating Image Maps
- Using Named Targets
- Getting All Parameter Names
- Getting Request Header Information
- Reset Buttons
- Summary
- Q&A
- Workshop
-
6. Creating JSP Components: JavaBeans
- Creating a Java Class
- Creating a Constructor
- Creating a Method
- Compiling a Java Class
- Installing a Compiled Java Class
- Using a Compiled Java Class
- Creating a Package
- Using a Package
- Passing Data to a Constructor
- Using <jsp:useBean>
- Creating a Read-Only Property
- <jsp:getProperty>: Getting a Property Value
- Creating a Read/Write Property
- <jsp:setProperty>: Setting Property Values
- Creating Private Methods
- Java Utility Classes: Working with Dates
- Summary
- Q&A
- Workshop
- 7. Tracking Users with Sessions and Cookies
-
2. At a Glance
-
8. Handling Errors
- Syntax Errors
- Runtime Errors
- Exceptions
- Using try/catch Blocks
- Handling Specific Exception Types
- Catching Multiple Exceptions
- Nesting try/catch Statements
- Throwing Exceptions Yourself
- Throwing Exceptions from Methods
- Creating a Custom Exception Object
- Printing to the Server Console
- Using Log Files
- Using JSP Error Pages
- Using JSP Error Pages: The exception Object
- Using JSP Error Pages: request Object Attributes
- Summary
- Q&A
- Workshop
- 9. Using Custom JSP Tags
- 10. Creating Custom Tags
- 11. Creating More Powerful JavaBeans
- 12. Creating Servlets
- 13. Creating More Powerful Servlets
- 14. Using Filters
-
8. Handling Errors
-
3. At a Glance
- 15. Handling Files on the Server
-
16. Getting Started with Databases
- What Are Databases?
- Java Database Connectivity
- JDBC Drivers
- Creating Connections
-
Using Structured Query Language
- Using the SELECT Statement
- Using WHERE Clauses
- Using the BETWEEN Clause
- Using the IN Clause
- Using the LIKE Clause
- Using Logical Operations
- Using the ORDER BY Clause
- Using the AS Clause
- Using the DISTINCT Clause
- Using Built-in Functions
- Using the GROUP BY Clause
- Using the DELETE Statement
- Using the UPDATE Statement
- Summary
- Q&A
- Workshop
- 17. Working with Databases
- 18. Using XML and XSLT in JSP
- 19. Using Struts
- 20. Creating Images on the Fly and Handling Internet Programming
- 21. Client-Side Programming and Deploying Your Projects
-
Appendixes At a Glance
-
A. Answers to the Quiz Questions
- Quiz Answers for Day 1
- Quiz Answers for Day 2
- Quiz Answers for Day 3
- Quiz Answers for Day 4
- Quiz Answers for Day 5
- Quiz Answers for Day 6
- Quiz Answers for Day 7
- Quiz Answers for Day 8
- Quiz Answers for Day 9
- Quiz Answers for Day 10
- Quiz Answers for Day 11
- Quiz Answers for Day 12
- Quiz Answers for Day 13
- Quiz Answers for Day 14
- Quiz Answers for Day 15
- Quiz Answers for Day 16
- Quiz Answers for Day 17
- Quiz Answers for Day 18
- Quiz Answers for Day 19
- Quiz Answers for Day 20
- Quiz Answers for Day 21
-
A. Answers to the Quiz Questions
Product information
- Title: Sams Teach Yourself JavaServer Pages™ in 21 Days
- Author(s):
- Release date: September 2002
- Publisher(s): Sams
- ISBN: None
You might also like
book
Windows Server® 2008 Active Directory® Resource Kit
Get the definitive, in-depth resource for designing, deploying, and maintaining Windows Server 2008 Active Directory in …
book
Special Edition Using Java™ Server Pages and Servlets
Special Edition Using JSP and Servlets starts by detailing the evolution of web servers that led …
book
Microsoft® Visual Studio® 2012 Unleashed, Second Edition
Microsoft Visual Studio 2012 significantly improves developer productivity across virtually all application lifecycle management tasks, while …
article
Reinventing the Organization for GenAI and LLMs
Previous technology breakthroughs did not upend organizational structure, but generative AI and LLMs will. We now …