Welcome to JavaServer Pages, 3rd Edition

Here you find all examples described in the book, as well as the JavaDocs for all Java classes used in the examples. I hope you will have fun reading the book and that you'll find the examples useful.

Hans Bergsten

Chapter 5

JSP is Easy easy.jsp

Chapter 6

Cartoon Bean cartoon.jsp
Cartoon Bean with JSTL cartoon2.jsp
Message Bean message.jsp

Chapter 7

Message Custom Action message.jsp

Chapter 8

JSTL Parameter Access input_jstl.jsp
JSTL Request Data Access reqinfo.jsp
Bean Parameter Access input_bean.jsp
JSTL Validation validate_jstl.jsp
Bean Validation validate_bean.jsp

Chapter 9

Improperly Terminated Directive error1.jsp
Improperly Terminated Action error2.jsp
Invalid Attribute Name error3.jsp
Missing End Quote error4.jsp
Missing EL Curly Braces error5.jsp
Missing End EL Curly Brace error6.jsp
Invalid Property Name error7.jsp
Invalid Parameter Name error8.jsp
Logical Error error9.jsp
Debug Output debug.jsp
Runtime Exception and Error Page calc.jsp
errorpage.jsp
Runtime Exception and Catch calc2.jsp

Chapter 10

Separate Validation Page userinfoinput.jsp
userinfovalidate.jsp
userinfovalid.jsp
Session and Application Scope Counters counter1.jsp
URL Rewriting counter2.jsp
Shopping Cart catalog.jsp
product.jsp
addtocart.jsp

Chapter 11

A Minimal Tag File copyright.jsp
copyright.tag
A Tag File Using Attributes message.jsp
motd.tag
A Tag File Using Undeclared Attributes headers.jsp
headers.tag
A Tag File Processing Body Content forum.jsp
htmlFormat.tag
A Tag File Processing Fragment Attributes even_and_odd.jsp
forEvenAndOdd.tag
A Tag File Exposing a Variable even_and_odd2.jsp
forEvenAndOdd2.tag
A Tag File Exposing a Variable With Any Name even_and_odd3.jsp
forEvenAndOdd3.tag

Chapter 12

All these examples require a database
Employee Registration enter.jsp
validate.jsp
store.jsp
confirmation.jsp
Employee Search search.html
find.jsp
list.jsp
delete.jsp
Getting a Few Rows at a Time maxrows.jsp
Displaying a Few Rows at a Time foreach.jsp

Chapter 13

All these examples require a database
Container-Provided Security, Employee Registration enter.jsp
validate.jsp
store.jsp
confirmation.jsp
Container-Provided Security, Employee Search search.html
find.jsp
list.jsp
delete.jsp
Application-Controlled Security, Project Billboard login.jsp
authenticate.jsp
main.jsp
entermsg.jsp
storemsg.jsp
updateprofile.jsp
logout.jsp

Chapter 14

Localized Poll Application poll.jsp
calculate.jsp
result.jsp
details_en.jsp
details_sv.jsp
details_de.jsp
Japanese Hello World
This example requires a browser with Japanese font
japanese.jsp
Localized Input for Western Languages input.jsp
process.jsp
Localized Input for Non-Western Languages
This example requires a browser with Japanese, Greek and Russian fonts
input_nw.jsp
process_nw.jsp

Chapter 15

WML Phone Book
This example requires a WML browser
phone_wml.jsp
XSLT to HTML Transformation phone_html.jsp
htmltable.xsl
Device-Dependent XSLT Transformation phone.jsp
html.xsl
wml.xsl
XML-Based News Service news.jsp

Chapter 16

Using Scriptlets scriptlet.jsp
Using Scriptlets With Code Fragments fragment.jsp
Declaring Variables counter.jsp
Declaring Methods color.jsp
All Scripting Elements allinone.jsp
Invalid Semicolon and Missing Brace error1.jsp
Invalid Scripting Element Type error2.jsp
Invalid Use of Class in Unnamed Package error3.jsp

Chapter 17

Including Page Segments page1.jsp
page2.jsp
page3.jsp
header.htmlf
footer.htmlf
navigation_jstl.jsp
navigation.jsp
Validation with JavaScript clientscript.jsp
Dynamically Generated JavaScript
This example requires a database
selections.jsp
dynamicscript.jsp
Using an Applet applet.jsp
Writing a JSP Document (XML Syntax) jspdocument.jspx

Chapter 19

Application-Controlled Security, Servlet and JSP
This example requires a database
login.jsp
main.jsp
entermsg.jsp

Chapter 21

Calendar Custom Action calendar.jsp
Temperature Converter Custom Functions convert.jsp

Chapter 22

Custom Tag Library Validator validation.jsp