Preface | p. xix |
Acknowledgments | p. xxv |
The Web Programming Environment | |
The Web Marketplace | p. 3 |
Evolution of the Web Application | p. 5 |
Birth of the Web | p. 6 |
Growth of the Web Programming Model | p. 6 |
The Shift from Client-Side to Server-Side Solutions | p. 9 |
Overview of the Hypertext Transfer Protocol (HTTP) | p. 11 |
What Is HTTP? | p. 12 |
A Language for Requesting Documents over the Internet | p. 12 |
The HTTP Specification | p. 12 |
HTTP Request Model | p. 13 |
Connecting to the Web Server | p. 14 |
Sending the HTTP Request | p. 15 |
Server Acceptance of the Request | p. 16 |
The HTTP Response from the Server | p. 16 |
Examples | p. 17 |
Summary | p. 21 |
Introduction to Servlets | p. 23 |
Servlet Lifecycle | p. 24 |
Init | p. 25 |
Service | p. 26 |
Destroy | p. 27 |
Example: Kilometers per Liter to Miles per Gallon Servlet | p. 27 |
Servlet Classes | p. 31 |
Servlet | p. 32 |
Servlet Request | p. 36 |
Servlet Response | p. 41 |
Servlet Context | p. 44 |
Threading Models | p. 47 |
SingleThreadModel | p. 49 |
HTTP Sessions | p. 49 |
The HttpSession Interface | p. 50 |
Summary | p. 52 |
JSP Overview | p. 53 |
How JSP Works | p. 54 |
A Basic Example | p. 56 |
Elements of JSP | |
JSP Syntax and Semantics | p. 63 |
The JSP Development Model | p. 64 |
Components of a JSP Page | p. 65 |
Directives | p. 65 |
Comments | p. 68 |
Expressions | p. 69 |
Scriptlets | p. 70 |
Declarations | p. 71 |
Implicit Objects | p. 74 |
Standard Actions | p. 75 |
Tag Extensions | p. 78 |
A Complete Example | p. 78 |
A Page Directive | p. 83 |
A [left angle bracket]jsp:include[right angle bracket] Action | p. 83 |
Scriptlet | p. 84 |
JSP Expressions | p. 85 |
A Declaration | p. 86 |
Summary | p. 87 |
Expressions and Scriptlets | p. 89 |
Expressions | p. 90 |
Scriptlets | p. 91 |
Expression and Scriptlet Handling by the JSP Container | p. 93 |
HTML Template Data and Expressions | p. 94 |
Scriptlet Contents | p. 94 |
Container-Generated Initialization and Exit Code | p. 96 |
Implicit Objects and the JSP Environment | p. 97 |
Request | p. 98 |
Response | p. 99 |
PageContext | p. 100 |
Session | p. 102 |
Application | p. 103 |
Out | p. 104 |
Config | p. 106 |
Page | p. 106 |
Exception | p. 106 |
Initialization Parameters | p. 107 |
Summary | p. 109 |
Declarations | p. 111 |
What Is a Declaration? | p. 112 |
Where Declaration Code Is Generated | p. 112 |
Primary Uses for Declarations | p. 117 |
Variable Declaractions | p. 117 |
Thread Safety and Instance Variables | p. 118 |
Method Definitions | p. 122 |
Overriding jspInit and jspDestroy | p. 126 |
Access to Implicit Objects | p. 128 |
Inner Classes | p. 128 |
Request Dispatching | p. 133 |
Anatomy of Request Processing | p. 134 |
Including Other Resources | p. 136 |
The include Directive | p. 136 |
How It Works | p. 137 |
Effect of Changes in an Included File | p. 138 |
Using the include Directive to Copy Source Code | p. 139 |
The [left angle bracket]jsp:include[right angle bracket] Action | p. 140 |
How It Works | p. 141 |
Which Method to Use | p. 153 |
Forwarding Requests | p. 154 |
The RequestDispatcher Object | p. 158 |
Request Dispatching vs. Redirection | p. 159 |
Model 1 vs. Model 2 | p. 159 |
Summary | p. 160 |
The Page Directive | p. 161 |
language | p. 162 |
extends | p. 164 |
Required Interfaces for a JSP Superclass | p. 164 |
A JSP Superclass Example | p. 166 |
import | p. 170 |
session | p. 172 |
buffer and autoFlush | p. 172 |
isThreadSafe | p. 173 |
info | p. 174 |
contentType | p. 174 |
errorPage and isErrorPage | p. 176 |
Summary | p. 181 |
JSP Tag Extensions | p. 183 |
Why Custom Tags? | p. 184 |
Developing Your First Custom Tag | p. 186 |
Define the Tag | p. 186 |
Create the TLD Entry | p. 187 |
Write the Tag Handler | p. 188 |
Incorporate the Tag into a JSP Page | p. 192 |
How Tag Handlers Work | p. 194 |
What the JSP Container Does | p. 194 |
What a Tag Handler Does | p. 196 |
Tag Libraries | p. 197 |
The Tag Library Descriptor (TLD) | p. 197 |
The taglib Directive | p. 199 |
The Tag Handler API | p. 200 |
The Tag Interface | p. 200 |
The TagSupport Class | p. 202 |
The Tag Handler Life Cycle | p. 202 |
The Flowchart | p. 204 |
An Example of Generated Code | p. 206 |
Defining Tag Attributes | p. 212 |
The Body Tag Handler API | p. 219 |
BodyContent | p. 219 |
The BodyTag Interface | p. 221 |
The BodyTagSupport Class | p. 222 |
The Body Tag Handler Life Cycle | p. 223 |
The Flowchart | p. 223 |
Defining Scripting Variables | p. 226 |
The TagExtraInfo Class | p. 227 |
Validating Tag Attributes | p. 236 |
Cooperating Tags | p. 236 |
Using Syntactic Scoping | p. 236 |
Implementation of the DatabaseQuery Example | p. 247 |
The Necessary Tags | p. 247 |
The Tag Library Descriptor | p. 248 |
The Tag Handlers | p. 249 |
Summary | p. 258 |
JSP in Action | |
HTML Forms | p. 261 |
The FORM Element | p. 263 |
Attributes of the FORM Element | p. 264 |
Form Input Elements | p. 268 |
Elements Created with the INPUT Tag | p. 270 |
Elements Created with select and option | p. 283 |
The textarea Element | p. 284 |
Form Validation | p. 285 |
The Contact Us Form with Validation | p. 285 |
The Server Side of Forms Handling | p. 287 |
Summary | p. 289 |
Database Access | p. 291 |
Overview of JDBC | p. 292 |
Basic JDBC Operations | p. 293 |
Essential JDBC Classes | p. 293 |
A Simple JDBC Example | p. 296 |
JDBC Drivers | p. 301 |
Driver Types | p. 303 |
The JDBC-ODBC Bridge | p. 303 |
Registering a Driver | p. 305 |
Connecting to a Database | p. 307 |
The JDBC Database URL | p. 308 |
The Statement Interfaces | p. 309 |
Statement | p. 309 |
PreparedStatement | p. 317 |
CallableStatement | p. 322 |
Result Sets | p. 328 |
Scrollable Result Sets | p. 332 |
Updatable Result Sets | p. 336 |
RowSets | p. 338 |
Using Metadata | p. 338 |
Database Metadata | p. 339 |
ResultSetMetadata | p. 349 |
New Features in JDBC 2.0 and Beyond | p. 351 |
Summary | p. 351 |
Session and Thread Management | p. 353 |
Session Tracking | p. 354 |
Hidden Fields | p. 355 |
URL Rewriting | p. 360 |
Cookies | p. 363 |
The Session API | p. 369 |
Creating Sessions | p. 370 |
Storing and Retrieving Objects from Sessions | p. 372 |
Destroying Sessions | p. 373 |
Examples Revisited | p. 374 |
Session Binding Listeners | p. 383 |
Thread Management | p. 390 |
Threading Concepts | p. 391 |
Servlet Threading Models | p. 403 |
Default Threading Model | p. 403 |
Single Threaded Model | p. 405 |
Multithreaded Applications | p. 406 |
Application Considerations | p. 411 |
Summary | p. 413 |
JSP and JavaBeans | p. 415 |
What Is a JavaBean? | p. 416 |
Bean Properties | p. 416 |
Persistence | p. 419 |
JSP Actions | p. 424 |
[left angle bracket]jsp:useBean[right angle bracket] | p. 425 |
[left angle bracket]jsp:setProperty[right angle bracket] | p. 430 |
[left angle bracket]jsp:getProperty[right angle bracket] | p. 434 |
A Complete Example--Personalization with Beans | p. 434 |
Getting Weather Data from the Web | p. 435 |
The LyricNote Portal | p. 444 |
Summary | p. 448 |
JSP and XML | p. 451 |
XML Overview | p. 452 |
The Problem XML Solves | p. 453 |
XML Syntax | p. 453 |
The Document Type Definition | p. 454 |
XML Parsers | p. 457 |
Document Object Model (DOM) | p. 458 |
Simple API for XML (SAX) | p. 472 |
XSL Transformations with XSLT | p. 486 |
XSLT in Action | p. 487 |
Summary | p. 491 |
JSP Testing and Debugging | p. 493 |
Building a Mental Model | p. 494 |
Translation and Compilation | p. 494 |
Testing in Isolation | p. 499 |
Debugging Tools | p. 500 |
Capturing Form Parameters | p. 501 |
A Debugging Web Client | p. 504 |
Tracing HTTP Requests | p. 510 |
Summary | p. 528 |
Deploying Web Applications | p. 529 |
The Web Application Environment | p. 530 |
Directory Structure | p. 530 |
Resource Mapping | p. 532 |
The Servlet Context | p. 535 |
The Web Archive (war) File | p. 535 |
The Deployment Descriptor--web.xml | p. 538 |
Sample Deployment Descriptor | p. 547 |
Summary | p. 549 |
Case Study: A Product Support Center | p. 551 |
Process Flow | p. 552 |
Data Model | p. 554 |
Developing the System | p. 555 |
Model-View-Controller Architecture | p. 556 |
Model Classes | p. 557 |
View Classes | p. 631 |
Controller Classes | p. 658 |
Summary | p. 676 |
JSP and Other Web Components | |
Communicating with Other Clients | p. 679 |
URL Connections | p. 680 |
The URL Class | p. 680 |
The URLConnection Class | p. 682 |
The HttpURLConnection Class | p. 683 |
Java Applications as Clients | p. 684 |
The JSP Price Quote Server | p. 684 |
The Price Quote Client Application | p. 687 |
A Java Applet Client | p. 689 |
The Java Plug-In | p. 690 |
The PriceQuoteApplet | p. 691 |
A Perl Client | p. 696 |
The Generic Database Select Server | p. 696 |
The Perl Script | p. 699 |
Summary | p. 702 |
Communicating with Other Servers | p. 703 |
Server-Side Scripting Environments | p. 704 |
Interoperating with HTTP | p. 704 |
Sending Mail from a JSP Page | p. 710 |
Approaches to Sending Mail | p. 710 |
E-Mail Notification in the Product Support System | p. 715 |
Summary | p. 719 |
Appendixes | |
Servlet API Version 2.3 | p. 723 |
Package javax.servlet | p. 724 |
Filter | p. 724 |
FilterChain | p. 725 |
FilterConfig | p. 725 |
GenericServlet | p. 726 |
RequestDispatcher | p. 729 |
Servlet | p. 730 |
ServletConfig | p. 731 |
ServletContext | p. 732 |
ServletContextAttributeEvent | p. 736 |
ServletContextAttributesListener | p. 737 |
ServletContextEvent | p. 738 |
ServletContextListener | p. 738 |
ServletException | p. 739 |
ServletInputStream | p. 740 |
ServletOutputStream | p. 740 |
ServletRequest | p. 743 |
ServletRequestWrapper | p. 747 |
ServletResponse | p. 752 |
ServletResponseWrapper | p. 755 |
SingleThreadModel | p. 758 |
UnavailableException | p. 758 |
Package javax.servlet.http | p. 760 |
Cookie | p. 760 |
HttpServlet | p. 763 |
HttpServletRequest | p. 767 |
HttpServletRequestWrapper | p. 772 |
HttpServletResponse | p. 777 |
HttpServletResponseWrapper | p. 780 |
HttpSession | p. 783 |
HttpSessionActivationListener | p. 786 |
HttpSessionAttributesListener | p. 787 |
HttpSessionBindingEvent | p. 788 |
HttpSessionBindingListener | p. 789 |
HttpSessionContext | p. 790 |
HttpSessionEvent | p. 790 |
HttpSessionListener | p. 791 |
HttpUtils | p. 791 |
JSP API Version 1.2 | p. 793 |
Package javax.servlet.jsp | p. 794 |
HttpJspPage | p. 794 |
JspEngineInfo | p. 795 |
JspException | p. 795 |
JspFactory | p. 796 |
JspPage | p. 798 |
JspTagException | p. 799 |
JspWriter | p. 800 |
PageContext | p. 804 |
Package javax.servlet.jsp.tagext | p. 810 |
BodyContent | p. 810 |
BodyTag | p. 811 |
BodyTagSupport | p. 812 |
IterationTag | p. 814 |
PageData | p. 814 |
Tag | p. 815 |
TagAttributeInfo | p. 816 |
TagData | p. 818 |
TagExtraInfo | p. 820 |
TagInfo | p. 821 |
TagLibraryInfo | p. 824 |
TagLibraryValidator | p. 826 |
TagSupport | p. 827 |
TagVariableInfo | p. 829 |
TryCatchFinally | p. 831 |
VariableInfo | p. 831 |
HTTP Reference | p. 833 |
HTTP Response Codes | p. 834 |
HTTP Headers | p. 836 |
Index | p. 845 |
Table of Contents provided by Syndetics. All Rights Reserved. |