This document lists all the source code examples featured
in the book, indicating the page number on which
they are found and where in the zip file to find
the code.
Page | Description | Source File Name |
95 |
Creating an object inside an expression
| chap06/examples/ShowTimeD.jsp |
95 |
Using a scriptlet to generate an ASCII table
| chap06/examples/ASCII_Table.jsp |
98 |
Shows what compiler does to scriptlet contents
| chap06/examples/c2f.jsp |
101 |
Shows how servlets are concatenated
| chap06/examples/Retained.jsp |
104 |
The out implicit object
| chap06/examples/OutDemo.jsp |
110 |
Output with implicit out object
| chap06/examples/colors1.jsp |
110 |
Output with explicit out variable
| chap06/examples/colors2.jsp |
120 |
Using a declaration to define class variables
| chap06/examples/vardec1.jsp |
120 |
Using a declaration to define instance variables
| chap06/examples/vardec2.jsp |
124 |
Using a declaration to define a method
| chap06/examples/methdef1.jsp |
125 |
Lists some system properties
| chap06/examples/ShowProps1.jsp |
127 |
Same but calls a declared formatting method
| chap06/examples/ShowProps2.jsp |
Page | Description | Source File Name |
135 |
Simple example of include directive
| chap07/examples/flavors.jsp |
135 |
HTML code included by flavors.jsp
| chap07/examples/flavor_list.html |
137 |
Same example using jsp:include
| chap07/examples/flavors2.jsp |
138 |
Servlet used in jsp:include example
| chap07/WEB-INF/src/com/jspcr/servlets/FlavorListServlet.java |
141 |
Using jsp:include to simulate a tabbed dialog
| chap07/examples/ShowRequest.jsp |
141 |
Subpage included by ShowRequest.jsp
| chap07/examples/ShowParameters.jsp |
141 |
Subpage included by ShowRequest.jsp
| chap07/examples/ShowServletRequestMethodValues.jsp |
141 |
Subpage included by ShowRequest.jsp
| chap07/examples/ShowHttpServletRequestMethodValues.jsp |
146 |
Subpage included by ShowRequest.jsp
| chap07/examples/ShowRequestHeaders.jsp |
147 |
Using parameters with jsp:include
| chap07/examples/params/Earth.jsp |
147 |
Page included by Earth.jsp
| chap07/examples/params/ShowDiameter.jsp |
149 |
How to retrieve the original URI in an included
page
| chap07/examples/ShowPath1.jsp |
149 |
Page included by ShowPath1.jsp
| chap07/examples/ShowPath2.jsp |
153 |
A non-visual JSP that forwards results to
another
| chap07/examples/forward/GetFoodGroups.jsp |
153 |
A data structure used by GetFoodGroups.jsp
| chap07/WEB-INF/src/com/jspcr/forward/FoodGroup.java |
154 |
Renders the output of GetFoodGroups.jsp
| chap07/examples/forward/ShowFoodGroups.jsp |
Page | Description | Source File Name |
164 |
Number guess guesser starting page
| chap08/examples/hidden/Start.jsp |
165 |
Number guess guesser guess display page
| chap08/examples/hidden/NextGuess.jsp |
167 |
Non-visual page that checks the number guess
| chap08/examples/hidden/CheckResults.jsp |
169 |
JSP page that announces the win
| chap08/examples/hidden/IWin.jsp |
170 |
JSP page that accuses the user of cheating
| chap08/examples/hidden/Cheater.jsp |
172 |
Page counter that uses URL rewriting
| chap08/examples/url/Counter.jsp |
175 |
Using persistent cookies to store preferences
| chap08/examples/cookies/CookieBasedWelcome.jsp |
175 |
Logo used in CookieBasedWelcome
| chap08/examples/cookies/images/lyric_note.png |
175 |
Resource bundle for CookieBasedWelcome
| chap08/WEB-INF/src/com/jspcr/sessions/welcome.properties |
175 |
German resource bundle for CookieBasedWelcome
| chap08/WEB-INF/src/com/jspcr/sessions/welcome_de.properties |
175 |
Spanish resource bundle for CookieBasedWelcome
| chap08/WEB-INF/src/com/jspcr/sessions/welcome_es.properties |
175 |
French resource bundle for CookieBasedWelcome
| chap08/WEB-INF/src/com/jspcr/sessions/welcome_fr.properties |
175 |
Italian resource bundle for CookieBasedWelcome
| chap08/WEB-INF/src/com/jspcr/sessions/welcome_it.properties |
188 |
Servlet that keeps track of the state of the
game
| chap08/WEB-INF/src/com/jspcr/sessions/GameState.java |
191 |
Number guess guesser starting page using session
API
| chap08/examples/hidden/sessionapi/Start.jsp |
191 |
Number guess guesser next guess page using
session API
| chap08/examples/hidden/sessionapi/NextGuess.jsp |
193 |
Number guess guesser CheckResults page using
session API
| chap08/examples/hidden/sessionapi/CheckResults.jsp |
194 |
Number guess guesser Cheater page using session
API
| chap08/examples/hidden/sessionapi/Cheater.jsp |
195 |
Number guess guesser "I Win" page using session
API
| chap08/examples/hidden/sessionapi/IWin.jsp |
196 |
Session API based page counter
| chap08/examples/url/sessionapi/CookieCounter.jsp |
197 |
Database connection that times out as a session
binding listener
| chap08/WEB-INF/src/com/jspcr/jdbc/BoundConnection.java |
200 |
A JSP subpage that uses BoundConnection
| chap08/examples/sessions/listeners/connect.jsp |
201 |
Application that uses connect.jsp
| chap08/examples/sessions/listeners/ComposerSearch.jsp |
206 |
Creating threads by subclassing java.lang.Thread
| chap08/examples/threads/ThreadExample1.java |
208 |
Creating threads by implementing Runnable
| chap08/examples/threads/ThreadExample2.java |
210 |
Implementing Runnable in an inner class
| chap08/examples/threads/ThreadExample3.java |
213 |
Creating threads with Timer and TimerTask
| chap08/examples/threads/TimerExample.java |
217 |
Unsynchronized threads with a bug
| chap08/examples/threads/SynchronizationTest.java |
217 |
Support file for SynchronizationTest
| chap08/examples/threads/invoice.dat |
225 |
Simulated authentication with a background
worker thread
| chap08/examples/threads/SimulatedAuthentication.jsp |
Page | Description | Source File Name |
407 |
Simple JDBC example
| chap15/examples/ShowDept.jsp |
423 |
Executing a query
| chap15/examples/QueryExample.jsp |
425 |
Updating with SQL UPDATE
| chap15/examples/UpdateExample.jsp |
428 |
SQL used by execute example
| chap15/examples/data.sql |
429 |
Using the execute() method
| chap15/examples/ExecuteExample.jsp |
433 |
Data file for BatchUpdateExample.
| chap15/examples/over90.csv |
433 |
Using batch update
| chap15/examples/BatchUpdateExample.jsp |
438 |
Using a prepared statement with a JNDI data
source
| chap15/examples/PreparedStatementExample.jsp |
448 |
Invoking stored procedures in MS Access
| chap15/examples/CallableStatementExample.jsp |
453 |
Using a result set
| chap15/examples/IrishComposers.jsp |
458 |
Using a scrollable result set
| chap15/examples/ScrollableResultSetExample.jsp |
463 |
Helper class for metadata explorer
| chap15/WEB-INF/src/com/jspcr/jdbc/tools/MetaDataEvaluator.java |
465 |
Form that invokes metadata explorer
| chap15/examples/MDForm.html |
466 |
Main JSP page for metadata explorer
| chap15/examples/MetaDataExplorer.jsp |
Page | Description | Source File Name |
474 |
Sample XML document
| chap16/dtd/birds.xml |
478 |
DTD for sample XML document
| chap16/dtd/song.dtd |
481 |
XML schema for sample XML document
| chap16/xsd/song.xsd |
495 |
Product catalog document
| chap16/examples/instruments.xml |
496 |
Java interface that represents one product
| chap16/WEB-INF/src/com/jspcr/xmlsamples/Product.java |
497 |
Iterator over a list of Product objects
| chap16/WEB-INF/src/com/jspcr/xmlsamples/ProductList.java |
497 |
Base class implementation of ProductList
interface
| chap16/WEB-INF/src/com/jspcr/xmlsamples/AbstractProductList.java |
499 |
DOM implementation of ProductList interface
| chap16/WEB-INF/src/com/jspcr/xmlsamples/DOMProductList.java |
503 |
Generic JSP page to display results
| chap16/examples/ClemensAltman.jsp |
505 |
DOM front-end to generic page
| chap16/examples/DOMSample.jsp |
506 |
SAX implementation of ProductList interface
| chap16/WEB-INF/src/com/jspcr/xmlsamples/SAXProductList.java |
509 |
SAX front-end to generic page
| chap16/examples/SAXSample.jsp |
512 |
XSLT stylesheet for generating web page
| chap16/WEB-INF/xslt/instruments.xsl |
514 |
Filter that applies XSLT transformation
| chap16/WEB-INF/src/com/jspcr/filters/XSLTFilter.java |
514 |
Helper class used by XSLTFilter
| chap16/WEB-INF/src/com/jspcr/filters/BufferedResponseWrapper.java |
519 |
Example of a JSP page in XML syntax
| chap16/examples/ClemensAltmanXML.jsp |
519 |
XML syntax of the DOM front-end to generic page
| chap16/examples/DOMSampleXML.jsp |
519 |
XML syntax of the DOM front-end to generic page
| chap16/examples/SAXSampleXML.jsp |
Page | Description | Source File Name |
525 |
Custom tag (with a bug)
| chap17/WEB-INF/src/TimerTag.java |
525 |
TLD for buggy tag
| chap17/WEB-INF/tlds/debug.tld |
526 |
JSP page that uses TimerTag
| chap17/examples/Timer.jsp |
530 |
Debugging JSP that captures form parameters
| chap17/examples/Echo.jsp |
532 |
JSP form that uses Echo for debugging
| chap17/examples/JobApplication.jsp |
535 |
Simple HTTP client for debugging
| chap17/WEB-INF/webclient/src/com/jspcr/debug/webclient/WebClient.java |
537 |
Mainline for WebClient
| chap17/WEB-INF/webclient/src/com/jspcr/debug/webclient/Main.java |
541 |
Proxy web server (man in the middle)
| chap17/WEB-INF/tracer/src/com/jspcr/debug/tracer/Tracer.java |
541 |
Logging interface used by tracer tool
| chap17/WEB-INF/tracer/src/com/jspcr/debug/tracer/Logger.java |
544 |
Mainline for tracer tool
| chap17/WEB-INF/tracer/src/com/jspcr/debug/tracer/Main.java |
547 |
Handles a single tracer request
| chap17/WEB-INF/tracer/src/com/jspcr/debug/tracer/RequestHandler.java |
Page | Description | Source File Name |
N/A |
Stylesheet for support application
| chap19/casestudy/style.css |
N/A |
Logo for application
| chap19/casestudy/images/logo.jpg |
N/A |
Title image for application
| chap19/casestudy/images/lyric_note.png |
N/A |
Deployment descriptor for case study
| chap19/casestudy/WEB-INF/web.xml |
584 |
A customer entitled to product support
| chap19/casestudy/WEB-INF/src/com/lyricnote/support/model/Customer.java |
587 |
A supported product
| chap19/casestudy/WEB-INF/src/com/lyricnote/support/model/Product.java |
591 |
A customer/product pair
| chap19/casestudy/WEB-INF/src/com/lyricnote/support/model/CustomerProduct.java |
594 |
An employee
| chap19/casestudy/WEB-INF/src/com/lyricnote/support/model/Employee.java |
599 |
A software problem tracked by the system
| chap19/casestudy/WEB-INF/src/com/lyricnote/support/model/Problem.java |
606 |
An update to a reported problem
| chap19/casestudy/WEB-INF/src/com/lyricnote/support/model/ProblemLog.java |
609 |
An event in the life of a problem
| chap19/casestudy/WEB-INF/src/com/lyricnote/support/model/Event.java |
612 |
The model component of the MVC triad
| chap19/casestudy/WEB-INF/src/com/lyricnote/support/model/Model.java |
637 |
HTTP-specific subclass of Model
| chap19/casestudy/WEB-INF/src/com/lyricnote/support/model/WebModel.java |
641 |
Sets the base URL for the application
| chap19/casestudy/SetBaseURL.jsp |
641 |
Displays the LyricNote logo and top menu
| chap19/casestudy/Banner.jsp |
642 | | chap19/casestudy/ErrorPage.jsp |
643 |
Prompts for customer search argument
| chap19/casestudy/Customers.jsp |
645 |
Selection list of customer search results
| chap19/casestudy/CustomersList.jsp |
647 |
Detail view of a single customer record.
| chap19/casestudy/Customer.jsp |
649 |
Page included from Customer.jsp to display
customer ID, name, and phone section.
| chap19/casestudy/CustomerInfo.jsp |
649 |
Page included from Customer.jsp to display
list of products purchased by this customer.
| chap19/casestudy/CustomerProductInfo.jsp |
651 |
Page included from Customer.jsp to display
list of problems reported by this customer.
| chap19/casestudy/CustomerProblemInfo.jsp |
653 |
Detail view of a single problem record.
| chap19/casestudy/Problem.jsp |
655 |
Included from Problem.jsp to generate the
problem details and problem update section.
| chap19/casestudy/ProblemInfo.jsp |
657 |
Included from Problem.jsp to display problem
history.
| chap19/casestudy/ProblemHistory.jsp |
659 |
Confirmation screen shown after problem update
| chap19/casestudy/Confirm.jsp |
660 |
Prompts for product search argument
| chap19/casestudy/Products.jsp |
661 |
Selection list of product search results
| chap19/casestudy/ProductsList.jsp |
664 |
Selection list of problems for a product
| chap19/casestudy/ProductProblems.jsp |
667 |
Prompts for a product ID
| chap19/casestudy/Problems.jsp |
671 |
The base class for all state transitions
| chap19/casestudy/WEB-INF/src/com/lyricnote/support/controller/Action.java |
673 |
The controller component of the MVC triad
| chap19/casestudy/WEB-INF/src/com/lyricnote/support/controller/ControllerServlet.java |
676 |
Searches database for customers matching search argument
| chap19/casestudy/WEB-INF/src/com/lyricnote/support/controller/CustomersSearchAction.java |
678 |
Gets detailed information for this customer
| chap19/casestudy/WEB-INF/src/com/lyricnote/support/controller/CustomersListSelectAction.java |
679 |
Creates new problem for customer
| chap19/casestudy/WEB-INF/src/com/lyricnote/support/controller/CustomerNewProblemAction.java |
680 |
Searches database for products matching argument
| chap19/casestudy/WEB-INF/src/com/lyricnote/support/controller/ProductsSearchAction.java |
681 |
Stores product ID in model
| chap19/casestudy/WEB-INF/src/com/lyricnote/support/controller/ProductsListSelectAction.java |
683 |
Stores problem ID in model
| chap19/casestudy/WEB-INF/src/com/lyricnote/support/controller/ProblemsSelectAction.java |
684 |
Submits a problem update
| chap19/casestudy/WEB-INF/src/com/lyricnote/support/controller/ProblemSubmitAction.java |