Chapter 12: Controlling the Structure of Generated Servlets:
The JSP page Directive
Complete source code for every example from this chapter, available free for unrestricted use.
Live links to all URLs cited in the chapter. More information. To view source code for other chapters in this book, mouse over the table of contents bar on the left.
Source Code from Chapter
Note: right-click or shift-click on the links to download the associated file.
JSP-Styles.css.
Style sheet used by many of the JSP pages in this chapter and throughout the book.
CookieUtilities.java.
Utility class from Chapter 8 that simplifies
the retrieval of cookie values. Remember that this class is in the coreservlets
package and thus needs to go in the coreservlets subdirectory. Used by
ImportAttribute.jsp.
LongLivedCookie.java.
Utility class from Chapter 8 that automatically
sets the cookie max age to one year. Remember that this class is in the coreservlets
package and thus needs to go in the coreservlets subdirectory. Used by
ImportAttribute.jsp.
Excel.jsp.
JSP page that (unconditionally) generates an Excel spreadsheet.
Illustrates the contentType attribute of the page directive.
ComputeSpeed.jsp.
JSP page that foolishly calls Double.parseDouble without catching
NumberFormatException.
Illustrates the errorPage attribute of the page directive.
SpeedErrors.jsp.
JSP page that displays errors for
ComputeSpeed.jsp.
Illustrates the isErrorPage attribute of the page directive.
More Information
announcements
Too few developers for
onsite courses? Try
our public courses in MD,
co-sponsored by Johns
Hopkins "Engineering
for Professionals":