abbr attribute, 340
Action elements
core library
c:catch, c:remove, and c:url, 111
c:forTokens, 112
c:if, c:choose, c:when, and c:otherwise, 111
c:import, c:redirect, and c:param, 112
c:out, c:set, and c:forEach, 109–111
i18n library (see i18n library)
standard actions (see Standard actions)
tag extension mechanism (see Tag extension mechanism)
Action.java, 223
Action.java (final), 224
align attribute, 339
ALTER TABLE statement, 399–400
American National Standards Institute (ANSI), 168
Apache JServ Protocol (AJP), 261
Apache Portable Runtime (APR) library, 263
Apache Service Manager icon, 8
Application architectures
Eclipse (see Eclipse)
Model 2 architecture, 50
E-bookshop (see E-bookshop)
Java beans, 50
online bookshop (see Online bookshop)
application object
conditional code enable and disable attribute, 27–28
javax.servlet.ServletContext interface, 27
logging control attribute, 28–30
org.apache.catalina.core.ApplicationContextFacade class, 27
ASCII standard, 321
Asynchronous JavaScript and XML (Ajax)
ActiveXObject, 209
ajaxFun, 208
ajax.js, 209
ajaxReq.raeyState codes, 210
ajax.xhtml, 208
f:ajax
commandButton element, 212
execute attribute, 215
h:body, 213
h:inputText element, 213
h:outputText element, 212, 213, 215
loginf.xhtml, 215
modified ajaxf.xhtml, 213
page with loginf, 214
render attribute, 213
serverTimeBean, 212
serverTimeBean.when, 213
IE, 210
server time, 209
time.jsp, 208
web.xml, 211
XMLHttpRequest object, 207
Atomicity, consistency, isolation, and durability (ACID), 381
attrName, 103
autoFlush field, 33
autoFlush object, 46
axis attribute, 340
balls_no_js.html, 374
buffer object, 46
bufferSize field, 33
Cascading Style Sheets (CSS), 59, 121, 122
div and span HTML elements, 360–361
Catalina engine, 262
char attribute, 340
charoff attribute, 340
CHECK column constraint, 397
check_logging.jsp, 29
Command line interface (CLI), 159
COMMIT and ROLLBACK statement, 401
composite library, 200
actionListener attribute, 228
composite:actionSource element, 229
composite:facet, 229
composite:implementation element, 226
composite:insertFacet, 229
composite:interface element, 226
composite:renderFacet, 229
flip.xhtml, 228
h:body element, 226
h:commandLink, 228
hello.xhtml, 226
implementation with empty interface, 227
with input element, 227
Constraints, 397
core library
Ajax (see Asynchronous JavaScript and XML (Ajax))
independent of render kit, 205–206
Coyote, 261
CREATE DATABASE statement, 394–395
CREATE INDEX statement, 397
CREATE TABLE statment, 395–397
CREATE VIEW statement, 398
Data Access Object (DAO), 177
Database (DB)
alter statement, 170
category_id and category_name, 169
category.java, 169
client/server architecture, 168
“cross-polluting” data, 168
delete statement, 170
E-shop access
BookPeer.getBookID method, 177–178
DataManager.insertOrder method, 179
data model structure, 176, 177
OrderDetailsPeer.insertOrderDetails method, 180
OrderPeer.insertOrder method, 179–180
Java API (see Java API)
MySQL (see MySQL)
organized data, 159
PostgreSQL, 159
select statement, 169
SQL standard, 168
SQL statements classification, 170
total confidentiality, 168
update statement, 169
User ID and password, 168
XML syntax
insertOrder method, 184
InsertOrderTag Definition in eshop.tld, 182–183
OrderConfirmation.jsp, 180–181
OrderConfirmation.jspx, 181–182
pageContext, 184
Data model methods, 287
Data packets, 317
Date and time data types, 387
daysInMonth function, 370
DELETE statement, 399
directive elements, 19
include directive, 47
page directive (see page directive)
taglib directive, 47
doAfterBody, 97
doEndTag, 93
do_it.jsp, 28
do_it_not.jsp, 28
do-while loop, 26
DROP statement, 399
DTD
attributeType, 124
DefaultHandler, 134
defaultValue, 124
ParsingExceptionHandler.java, 135
shuttle element, 124
starfleet.dtd, 124
starfleet_validate_dom.jsp, 137–138
starfleet_validate_sax.jsp, 135–137
starship elements, 124
warning, error, and fatalError methods, 134
E-bookshop. See also Online bookshop
Book.java, 58
folder structure, 61
batch file, 61
class files, 61
classpath switch, 61
compile_it.bat, 61
javax.servlet package, 61
META INF folder, 63
myLibs folder, 62
qwertyuiop package, 62
ShoppingServlet.java, 62
WAR file, 63
web.xml, 62
E-bookshop Home Page index.jsp, 52–54
expression elements, 54
index.jsp, 54
scriptlets, 54
HTML Generated by index.jsp, 59–60
servlet
control occasions, 57
doGet() method, 57
doPost() method, 57
ebookshop.cart attribute, 57
init() method, 57
ShoppingServlet.java code, 54–57
shopping cart, 51
Eclipse
disadvantages, 69
download, 64
IDE, 63
MD5 checksum, 64
new Web project
Generate web.xml deployment descriptor, 67
index.jsp, 68
output, 69
test project, 68
web-app element, 69
Web Module, 67
occasional bugs, 70
plug-ins, 63
Welcome screen, 64
Workbench screen, 65
ECMAScript, 364
Element type, 123
enterprises_transform.jsp, 150–151
enumeration attribute, 129
enumPar.nextElement(), 17
errorPage object, 46
E-shop, 281. See also Online bookshop
book categories, 284
book details, 287
book selection and search, 286
CategoryPeer.java—getAllCategories Method, 285
DataManager method, 285
DB access
BookPeer.getBookID method, 177–178
DataManager.insertOrder method, 179
data model structure, 176, 177
OrderDetailsPeer.insertOrderDetails method, 180
OrderPeer.insertOrder method, 179–180
files, 281
hash table, 285
home page, 284
HTML page generation, 281
index.jsp page, 283
MVC architecture, 281
order acceptance
ccExpiry.jsp, 298
checking out, 289
credit–card number, 297
empty–form check, 291
individual field validation, 294, 295
minimalist approach, 295
modified Checkout.jsp, 291–292
nonemptyForm.js, 290
numberOk and expiryOk, 295
server validation, 299
two flags, 294
validation, 290
ZIP code, 290
payment details, 299
search request code, 284
shopping cart
action parameter value, 289
addItem and showCart, 288
CartItem class, 288
session attribute, 288
setQuantity method, 289
update form, 288
ShopServlet.java–doPost method, 282–283
eshopf
annotated list of files, 308–309
JSP documents, 312
style sheet
box, 310
box_p files, 311
cascading mechanism, 310
correct style search box, 312
search box, 311
span element, 312
web.xml and context.xml, 309–310
eshopx
files, 300
JSP documents
InsertOrderTag.java method, 305
JSTL core, 305
OrderConfirmation.jsp, 303–304
OrderConfirmation.jspx, 305
web.xml
base and imageURL, 302
Eclipse, 303
Servlet 3.0, 303
Tomcat, 302
Ethernet connection, 319
Exec_http.java, 5
Expression Language (EL), 20
ArrayIndexOutOfBoundsException, 105
c:set JSTL core action, 107
header.user and agent, 106
Implicit Objects, 107
Java statement, 104
myBean.getProp(), 105
myKey, 105
NullPointerException, 105
operators, 105
sessionScope, 107
value attribute, 104
variableName, 104
extends attributes, 46
Extensible Stylesheet Language (XSL)
XPath
comment(), 142
context node, 141
implicit JSP objects mapping, 141
node(), 142
node set, 140
processing-instruction(), 142
slash separator, 140
text(), 142
XSL-FO, 139
XSLT
browser-side XSL transformation, 148–150
format transformation, 146–147
server-side XSL transformation, 150–151
XML to HTML transformation, 147–148
x:transform and x:param, 152
Facelet library, 200
action controllers and action listeners, 223–224
tags, 216
templ application
first page, 217
first.xhtml, 218
folders and files, 217
h:body element, 218
h:outputStylesheet element, 221
header.xhtml, 221
page2.xhtml, 219
page3.xhtml, 219
second page, 217
template attribute, 220
ui:composition element, 220
ui:insert, 221
web.xml, 222
Facelets, 197
for loop, 26
for-each loop, 27
Foreign key, 379
Form event attributes, 334
fractionDigits attribute, 129
getBufferSize method, 33
getDate method, 93
getParameterMap, 17
getParameterNames, 17
getRemoteAddress method, 15, 35
getRemoteHost method, 35
Graphical user interfaces (GUIs), 159
h:selectBooleanCheckbox, 204
h:selectManyCheckbox, 204
h:selectManyListbox, 204
h:selectManyMenu, 204
h:selectOneListbox, 204
h:selectOneMenu, 204
h:selectOneRadio, 204
HTML
documents
Flash format video clip display code, 331
Flash movies/streams, 331
indentation and spacing, 330
interprets and renders, 330
JPEG image display code, 331
MPEG movie file download code, 331
nesting, 329
start tag, 329
library
h:select* Elements (see testf project)
html tags and HTML elements, 200–201
HTTP Servlet class, 22
Implicit objects
application object
conditional code enable and disable attribute, 27–28
javax.servlet.ServletContext interface, 27
logging control attribute, 28–30
org.apache.catalina.core.ApplicationContextFacade class, 27
pageContext object, 34
request object (see request object)
response object, 43
include directive, 47
info attributes, 46
i18n library
fmt:bundle, fmt:setTimeZone, and fmt:timeZone, 115–116
fmt:ParseDate, fmt:formatDate, and fmt:requestEncoding, 117–118
fmt:parseNumber and fmt: formatNumber, 116–117
fmt:setLocale, fmt:setBundle, fmt:setMessage, and fmt:param, 112–115
InputSource class, 136
Integrated Development Environment (IDE), 63
Internet Assigned Numbers Authority (IANA), 318
Internet Protocol (IP), 317–319
isELIgnored attributes, 46
isErrorPage object, 46
isScriptingEnabled attributes, 46
Jasper, 263
Java API
data access
executeUpdate method, 175
Statement class, 173
database connection
connection.close(), 173
DataManager.getConnection method, 173
DataManager.putConnection method, 173
init parameter, 172
transactions, 176
Java Community Process (JCP), 10
Java data types, 21
Java Development Kit (JDK), 3
Java Enterprise Edition (JEE), 10
java.lang library, 22
Java Naming and Directory Interface (JNDI), 239, 263
Java runtime environment (JRE), 3
JavaScript
Ajax, 364
animation
date checking and correction
client-side checks, 365
ECMAScript, 364
Netscape Navigator web browser, 364
responding events, 365
JavaServer Faces (JSF) 2.2
life cycle, 198
apply request values, 198
event handling, 199
invoke application, 198
process validation, 198
render response, 199
restore view, 198
update model values, 198
simplef application
AString.java, 194
AString.java (annotated), 195
aStringBean.getStr() method, 191
aStringBean object, 194
core and html libraries, 191
first page, 190
f:view element, 191
h:commandButton element, 191, 192
h:form element, 191
h:outputText element, 191, 192
HTML page, 191
index.jsp, 192
second.jsp, 191
second page, 190
simplefx and simpleh applications, 195–197
tag libraries
composite library (see composite library)
core library (see core library)
facelet library (see Facelet library)
HTML library (see HTML library)
UI components, 189
web application development, 189
JavaServer Faces and eshop
CCNumberConverter.java, 241–243
Checkout page, 237
custom components
InputEntryComponent.java, 249–250
faces-config.xml, 257
home page, 231
registering converter, application, 243
Top Menu, 232
using converter, 243
validation mechanisms
application-level validation, 245
built-in validators, 244
web.xml, 238
JavaServer Pages (JSP)
action elements, 19 (see also Action elements)
application architectures (see Application architectures)
comments and escape characters, 90
definition, 2
directive elements, 19
include directive, 47
page directive (see page directive)
taglib directive, 47
dynamic content addition, 9
expression language (see Expression language (EL))
Hello World!
in Boring JSP Page, 13
getRemoteAddr() method, 15
with Google Chrome, 15
hello.html, 12
Java code, 14
with Mozilla Firefox, 15
out variable, 15
in plain HTML, 13
request variable, 15
servlet execution, 15
XHTML standard, 12
history, 10
HTML-request parameters, 16–17
installation packages, 2
Java installation
Environment Variables double dialog, 3, 4
JDK, 3
JRE, 3
Path variable updation, 4
software download procedure, 3
Java servlets, 2
online services, 9
plain HTML page, 1
scripting elements, 19
data types and variables, 21–23
declarations, 21
implicit objects (see Implicit objects)
operators, assignments, and comparisons, 24–25
scriptlets, 20
Tomcat installation
communication ports, 6
netstat /a command, 6
Service and Native settings, 8
Services control panel, 8
Java Specification Request (JSR), 10
Java Virtual Machine (JVM), 172
javax.servlet.http.HttpServletRequest interface, 34
javax.servlet.http.HttpServletResponse interface, 43
javax.servlet.http.HttpSession interface, 44
javax.servlet.jsp.JspContext class, 34
javax.servlet.jsp.JspWriter class, 33
javax.servlet.jsp.PageContext class, 34
javax.servlet.ServletConfig interface, 30
javax.servlet.ServletRequest interface, 34
javax.servlet.ServletResponse interface, 43
JDBC drivers, 172
JSP. See JavaServer Pages (JSP)
JSP Fragment (JSPF), 47
JSP Segments, 47
JSP Standard Tag Library (JSTL), 10, 107–109
JspWriter class, 33
Keyboard attributes, 333
Keyboard event attributes, 334
Large objects (LOB), 388
log_off.jsp, 29
managed-bean element, 194, 195
maxExclusive attribute, 129
maxInclusive attribute, 129
Mind Reading Markup Language (MRML), 121
minExclusive attribute, 129
minInclusive attribute, 129
Model view controller (MVC) design pattern, 50
Mouse event attributes, 335
MyBundle_en.java, 113
MyBundle_it.java, 113
MyLog.java, 30
myObj variable, 84
alternatives
jdbcDriver, 184
ODBC Data Source control panel, 185
ODBC Microsoft Excel setup, 186
Select Workbook, 186
table.xls, 185
list of all books, 165
log of shop_create.sql, 162
shop database creation, 164
shop_create.sql, 161
Workbench, 163
Netscape Navigator web browser, 364
Object event attributes, 333–334
ON DELETE and ON UPDATE elements, 396
Online bookshop
architecture
request handling, 76
view, 76
customer interface
book category, 72
book’s details, 73
home page, 72
shopping cart, 73
object-oriented approach, 71
objects and operations
books, 71
order, 72
PayPal, 71
product categories, 71
Open Database Connectivity (ODBC) driver, 172
org.apache.catalina.connector.ResponseFacade class, 43
org.apache.catalina.core.StandardWrapperFacade class, 30
org.apache.catalina.session.StandardSessionFacade class, 44
org.apache.jasper.runtime.JspWriterImpl class, 33
org.apache.jasper.runtime.PageContextImpl class, 34
PageContext class, 34
pageContext object, 34
page directive
concurrency.jsp, 45
concurrency2.jsp, 46
HTML output, 44
isThreadSafe attribute, 45, 46
page-dependent properties, 44
scripting language, Java, 44
syncK variable, 46
pageEncoding attributes, 46
param action, 87
Partial web.xml, 75
pattern attributes, 129
Primary key, 379
Privacy Enhanced Mail (PEM), 273
Project Object Model (POM), 189
Protocol layers, 317
Protocol stacks, 317
Protocol suites, 317
Real Estate Transaction Markup Language (RETML), 121
Remote address filter, 264
Remote host filter valve, 264
removeAttribute method, 34
req_params.jsp output, 17
Request dumper valve, 264
request object
org.apache.catalina.connector.RequestFacade class, 34
IE, 42
Opera, 42
request header
Google Chrome, 36
Microsoft Internet Explorer, 37
Mozilla Firefox, 37
Opera, 38
request parameters and client info, 34–35
user authentication
BASIC authentication method, 39
canDoThis and canDoThat, 38
getAuthType method, 40
tomcat-users.xml fragment, 38
response object, 43
RFC 3986 standard, 320
scope attribute, 342
scriptless, 94
Scriptlets, 20
sendError method, 43
session attributes, 46
SET TRANSACTION statement, 401
setDate method, 93
setStatus method, 43
shop.jspx, 301
shop_orders.sql, 171
ShopServlet.java - init method, 74–75
Simple API for XML (SAX), 134
simplef application
AString.java, 194
AString.java (annotated), 195
aStringBean.getStr() method, 191
aStringBean object, 194
core and html libraries, 191
first page, 190
f:view element, 191
h:commandButton element, 191, 192
h:form element, 191
h:outputText element, 191, 192
HTML page, 191
index.jsp, 192
second.jsp, 191
second page, 190
simplefx applications, 195
simpleh applications, 195
Single sign on valve, 264
stack_trace.jsp, 31
Standard actions
element, attribute, and body actions, 87–88
fallback action, 88
flush attribute, 80
include action, 80
jsp:param, 80
jsp:text action, 87
param action, 88
setProperty and getProperty actions
myAttr, 84
MyClass.java, 86
myObj.jsp, 87
OrderConfirmation.jsp, 85
trimDirectiveWhitespaces, 87
Standard Generalized Markup Language (SGML), 124
START TRANSACTION statement, 400
stringArray, 23
Structured Query Language (SQL)
ALTER TABLE statement, 399–400
COMMIT and ROLLBACK statement, 401
conventions, 382
CREATE DATABASE statement, 394–395
CREATE INDEX statement, 397
CREATE TABLE statement, 395–397
create, update, and delete keywords, 383
CREATE VIEW statement, 398
data types
characters, 387
date and time, 387
large objects (LOB), 388
DELETE statement, 399
DROP statement, 399
reserved SQL keywords, 401–404
SELECT statement
description, 389
SET TRANSACTION and START TRANSACTION, 400–401
terminology, 379
transactions
ACID properties, 381
elementary operations, 380
money transfer, 380
UPDATE statement, 400
Sub-elements, 123
Tables
header, body, and footer, 344–345
HTML code, 335
HTML-generated table, 336
row and cell alignment
abbr and axis, 340
align, char, and charoff, 339–340
cell elements, 339
scope, 342
valign, 340
structure, 337
table.html, 336
width, 337
Tag extension mechanism
bodied custom actions
TLD, 97
bodyless custom actions
webapps folder, 91
tag files
bodied tag, 100
tag directive, 101
Tag handlers, 91
Tag library descriptor (TLD), 91
bodied custom actions, 97
bodyless custom actions, 93–94
tagdependent, 94
taglib, 94
testf project
components, 204
f:selectItem and f:selectItems tags, 204
h:panelGrid and h:panelGroup, 204
output, 202
select attribute, 205
Tomcat
Apache Software Foundation, 259
architecture
cluster, 263
components, 260
connector, 261
context, 260
engine, 262
Global Naming Resources, 263
host, 261
listener, 263
loader and manager, 264
Realm, 263
server, 262
service, 262
valve, 264
communication ports, 6
directory
bin, 265
conf, 265
lib, 265
logs, 266
temp, 265
top directories, 265
webapps, 266
work, 266
HTTP port 80, 269
HTTPS
domain name mismatch, 276
JSSE and APR, 273
openssl.cfg, 271
secure socket layer, 271
security certificate, 275
security report, 274
transport layer security, 271
unknown authority, 274
Java servlets execution, 259
JSP pages/documents to Java servlets conversion, 259
netstat /a command, 6
request log
AccessLogValve, 267
directory attribute, 268
Service and Native settings, 8
Services control panel, 8
virtual host creation, 269–271
web server, 259
Tomcat 7.0.28, 259
tomcat-users.xml file, 38
toString() method, 32
totalDigits attribute, 129
TransformerExceptionHandler.java, 151
Transmission Control Protocol (TCP), 318
trimDirectiveWhitespaces object, 46
Uniform Resource Identifier (URI), 320, 388
Universal Business Language (UBL), 121
UPDATE statement, 400
updateMonthDays, 370
updateNull(column-index) method, 175
updateNull(column-label) method, 175
User Datagram Protocol (UDP), 318
valign attribute, 340
Web page
Cascading Style Sheets (see Cascading Style Sheets (CSS))
event attributes
form, 334
keyboard, 334
mouse, 335
types, 333
HTML (see HTML)
image maps
bottom line, 357
image splitting with table, 351–353
input forms
browser translation, 348
input elements, 345
Submit button, 347
textarea element, 345
JavaScript (see JavaScript)
standard attributes
keyboard attributes, 333
tables (see Tables)
URLs, hosts, and paths, 320–321
weekday.jsp, 95
while loop, 26
whiteSpace attributes, 129
wireless LAN, 319
World Wide Web Consortium (W3C), 12
Wrapper classes, 21
x:param, 152
x:transform, 152
XML
captain attribute, 123
CDATA section, 123
child nodes, 123
element node, 123
JSTL, 139
schemas
elementFormDefault, 125
minOccurs and maxOccurs, 126
occurrence constraints, 126–127
starfleet element, 126
starfleet.xsd, 125
starship element, 126
starship attribute, 123
syntax
CDATA section, 154
insertOrder method, 184
InsertOrderTag Definition in eshop.tld, 182–183
JSP documents, 153
jsp:text action, 154
jsp:text content, 154
OrderConfirmation.jsp, 180–181
OrderConfirmation.jspx, 181–182
pageContext, 184
validation
DTD (see DTD)
parsers, 134
results, 133
XSL (see Extensible Stylesheet Language (XSL))
XPath
comment(), 142
context node, 141
implicit JSP objects mapping, 141
node set, 140
node(), 142
processing-instruction(), 142
slash separator, 140
text(), 142
XSL Formatting Objects (XSL-FO), 139
XSLT
browser-side XSL transformation, 148–150