Index
Symbols
%= delimiter 166, 170
<%@ include %>. See include directive
A
absolute URI 287
abstraction 377
access control list 140
accessing JavaBean 269
ACL. See access control list
actions 19, 166, 171, 364, 366, 368, 372
custom 286
forward 225
include 223
plugin 171
standard 172
syntax 172
active resources 22
Active Server Pages 15
addCookie() 43
addDateHeader() 43
addHeader() 43
addIntHeader() 43
alias 366
Apache
Jakarta Project 287
Software Foundation 8
tag libraries 287
Tomcat 8
Web Server 7
application 200
events 88
scope 207
server 22
state 120
APPLICATION_SCOPE 210
applicationScope 236, 239, 500
architecture
in JSP 18
J2EE 15
Model 1 18
Model 2 18
multi-tier 400
attacks 141
attrib 367
attribute 313–314, 357, 359–362, 365–374
attribute scopes 55
context scope 55
request scope 55
session scope 55
attributeAdded() 86–87
attributeRemoved() 87
attributeReplaced() 87
auditing 141
authentication 140
authentication mechanisms 142
web applications 146
authorization 140
authorization constraint 149
autoFlush attribute 184
B
Base64 145
basic authentication 143
bean
containers 252
initialization 265
variable scope 265
beanName 260
BigDecimal 242, 249
BigInteger 242, 249
body content 313, 316, 353–360, 362–363, 366–374
empty 316
JSP 317
tagdependent 317
BodyContent 319
getEnclosingWriter() 337
getString() 337
BodyTag 319, 333, 353–357, 359, 362
doInitBody() 333–334
EVAL_BODY_BUFFERED 333–334
EVAL_BODY_TAG 333
example 336
setBodyContent() 333–334
BodyTagSupport 319, 339, 355–357, 374
methods 339
body-value 363
buffer attribute 184
bufferSize 239
business delegate 393
business logic 237
C
caching
GET vs. POST 33
response page 43
results of remote invocations 396
static data 47
Value List Handler pattern 381
CGI scripts 5
See also Common Gateway Interface
class attribute 259
class files 69
classes directory 69
WEB-INF 69
Class.forName() 46
client authentication 145
code reviews 141
collection access 236, 241–242, 249, 501
comments 166, 172
committed 44
Common Gateway Interface 4
limitations 5
compilation
of JSP class into servlets 176
page 175
phase 176
servlets 9
components
application 18
controller 17
J2EE 22
JavaBeans 251
of URI 76
reusing JSP 220
reusing software 219
web 22
conditional statements 191
confidentiality 141
config 204
configuration web application 90
CONNECT 25
containsHeader() 43
content type, common values 42
Content-Length 25
Content-Type 25
contentType attribute 185
context
path 76
scope 55
See also Servlet Context
contextDestroyed() 88–89
contextInitialized() 88–89
cookies 43, 121, 132, 236, 239–240, 500
co-operative tags 343
CORBA 379
custom tags 172
and JavaBeans 347
as custom actions 286
attributes 295
body content 296
buffering the body content 339
descriptor 287
empty 294
hierarchy 322
informing JSP engine 288
libraries 287
nested 297
prefix 293
usage 293, 298
usage in JSP pages 293
validation 347
D
data access object 382
data integrity 141
data privacy 141
<declaration> 211, 213
declarations 168
and variable initialization 191
JSP 20
JSP syntax 166
jspDestroy() 178
jspInit() 178
order in JSP 190
order of 190
syntax 168
translated as 189
XML syntax 213
declarative security 149
example 152
default web application 70–71
:definition 90
DELETE 25
delimiters 17, 170
denial of service attacks 142
deployment descriptor 23, 46, 70, 246, 248–249
overview 71
properties 71, 238, 355–356, 367, 369
sample 72
servlet 73
description 312–313, 315
design patterns 377
business delegate 393
data access object 382
distributed 379
front controller 389
gang of four 377
J2EE 379
model-view-controller 18, 116, 385–386, 391
page-by-page iterator 381
paged-list 381
required for SCWCD 382
service activator 382
service-locator 382
tiers 380
value list handler 381
value object 397
destroy() 48, 104
digest authentication 145
<directive.include> 213
<directive.page> 213
example 211
directives 167, 288
include 167, 220
JSP 19, 167
JSP syntax 166
page 167
syntax 168
taglib 167, 288
translated as 189
XML syntax 213
display-name 312–313
distributed environment 92
HttpSession 93
ServletContext 92
session migration 129
systems 21
web applications 92
div 242
doAfterBody() 329, 353, 356
document root 68
doDelete() 35
doEndTag() 320, 322, 353, 356
doFilter() 104–105
doGet() 35
doHead() 35
doInitBody() 333–334
doOptions() 35
doPost() 35
doPut() 35
doStartTag() 320, 322, 353, 356
doTag() 353–358, 360–362, 372–374
doTrace() 35
doXXX() 35–36
parameters 36
dynamic attributes 359–360, 362, 367–368, 372–373
dynamic inclusion 223
passing parameters 226
sharing objects 228
DynamicValues 359
E
EJB container 22
EL 236–249, 356, 361–362, 364, 366–367
empty tag 294, 324
with attribute 326
empty value 316
encodeRedirectURL() 134
encodeURL() 134
Enterprise JavaBeans
components 380
support 7
error conditions 45
errorPage attribute 182
escape sequences 194
in attributes 195
in scripting elements 195
in template text 194
EVAL_BODY 354, 373
EVAL_BODY_AGAIN 329–330
EVAL_BODY_BUFFERED 333–334
EVAL_BODY_INCLUDE 321–322
EVAL_BODY_TAG 333
EVAL_PAGE 321, 323, 354, 373
events listeners 85, 88
:example 108, 291, 410
exception implicit variable 206
explicit mapping 290, 313
Expression Language 236–238, 240–241, 245, 249, 355, 371
<expression> 212–213
expressions 170, 237–238, 240–242, 247, 249
and implicit variable out 203
JSP 20, 170
JSP syntax 166
request-time attribute 194, 213
syntax 170
translated as 189
valid and invalid 170
XML syntax 213
extends attribute 184
F
fail over 92
Filter 103
destroy() 104
doFilter() 104
init() 103
FilterChain 105
doFilter() 105
FilterConfig 105
filters 98
API 102
chain 98
configuration 106–107
example 100
in MVC 116
threading 116
uses 99
findAncestorWithClass() 338, 345–346, 356
findAttribute() 210
forEach 367
Form-based authentication 146
advantages 146
disadvantages 146
forward action, usage 225
forward() 57, 203
<forward> 20, 171, 223
forwarding a resource 57–58
fragment 362, 368–370
front controller 389
FTP 4
function 236, 241, 244–249
function-class 245–246
function-signature 246
G
Gang of Four 377
GenericServlet 11
getServletContext() 85
init() 47
GET 25, 33
features 33
getAttribute() 56, 123, 210
getAttributeNames() 56
getAttributeNamesInScope() 210
getAttributesScope() 210
getBodyContent() 339, 357, 362, 374
getEnclosingWriter() 337
getExpressionEvaluator() 355
getFilterName() 105
getHeaderNames() 39
getHeaders() 39
getInitParameter() 50, 84, 105
getInitParameterNames() 50, 84, 86, 105
getJspBody() 356–357, 362, 369, 373
getJspContext() 354, 356–358, 361–363, 373–375, 471
getNamedDispatcher() 58
getOut() 354–355, 361–363, 374
getOutputStream() 41–42
getParameter() 37–38, 239
getParameterNames() 37–38
getParameterValues() 37–38, 156
getParent() 320, 355, 357, 372–373, 375
getPreviousOut() 339
getProperty(), automatic type conversion 278
<getProperty> 269
getRealPath() 54, 179
getRemoteUser() 156
getRequestDispatcher() 57
getResource() 53
getResourceAsStream() 53
limitations 54
getServletContext() 50, 105, 238
getServletInfo() 189
getServletName() 50, 52
getServletSession() 238
getSession() 123
getString() 337
getUserPrincipal() 156
getValue() 339
getValues() 339
getVariableResolver() 355
getWriter() 42
GoF. See Gang of Four
H
hashcode 141
HEAD 25, 34
header 24, 26, 38–40, 236, 239–241, 500
management 43
names 43
headerValues 236, 239–242, 500
HTML
comments 172
example Hello User 16
files on web server 5, 69
FORM and HTTP methods 33
FORM for authentication 146
MIME type 185
tables 361
tags and Java code 15
template 15
URL-rewriting 133
HTML output
from custom tags 294, 324
from expressions 170
from JSP page 17
from scriptlets 169
using implicit variable 203
using PrintWriter 40
HTTP 23, 239
basic authentication 143
advantages 144–146
disadvantages 144
basics 24
error conditions 45
GET 25
HEAD 25
methods 32
comparison 33
POST 25
PUT 26
request 24
response 26
status codes 45
HTTP Digest authentication 145
advantages 145
disadvantages 145
HTTP request, servlets 35
HttpJspPage 177
HTTPS 145
HTTPS client authentication 145
advantages 145
disadvantages 146
HttpServlet 12, 35
request processing 35
service() 35
HttpServletRequest 12, 36–37
getHeader() 39
getHeaderNames() 39
getHeaders() 39
getRemoteUser() 156
getUserPrincipal() 156
isUserInRole() 156
methods to identify users 156
HttpServletRequestWrapper 110
example 112
HttpServletResponse 12, 43
containsHeader() 43
encodeRedirectURL() 134
encodeURL() 134
sendRedirect() 44
setDateHeader() 43
setHeader() 43
setIntHeader() 43
status codes 45
HttpServletResponseWrapper 110
example 112
HttpSession 121, 239
distributed environment 93
example 122
getAttribute() 123
getSession() 123
invalidate() 130
isNew() 132
setAttribute() 123
setMaxInactiveInterval() 131
usage 122
HttpSessionActivationListener 94, 129
sessionDidActivate() 129
sessionWillPassivate() 129
HttpSessionAttributeListener 86–87, 125
attributeAdded() 86
attributeRemoved() 87
attributeReplaced() 87
HttpSessionBindingEvent 125
HttpSessionBindingListener 125, 128
example 125
valueBound() 125
valueUnbound() 125
HttpSessionListener 126
example 127
sessionCreated() 126
sessionDestroyed() 126
I
id attribute 259
IllegalArgumentException 94
IllegalStateException 42, 44
implicit mapping 290, 312
implicit objects 198, 200, 210, 259
accessing form custom tags 339
implicit variables 198, 200, 236, 238, 240–241, 249
application 200
config 204
declaration 200
exception 206
out 203
page 202
pageContext 202
request 202
response 202
session 201
import attribute 182
in process servlet container 6
inactivity of session 122
include action, usage 223
include directive 167, 220
accessing variables 221
include() 57, 203
<include> 171
including a resource 57–58
info attribute 185
init() 46, 103
init(ServletConfig) 49
integrity attacks 142
invalidate() 130
IP 121
isELIgnored 367
isErrorPage attribute 182, 206
isNew() 132
ISO-8859-4 42
isUserInRole() 156
IterationTag 319, 329, 353–354, 356–357, 359, 362
doAfterBody() 330
EVAL_BODY_AGAIN 330, 333
example 331
iterative statements 191
J
J2EE pattern catalog 381
JAR
classpath 9
content type 41
file 69
jar command 70
location in a web application 69
sending to browser 41
servlet.jar 9
Java Standard Tag Library 237
JavaBeans
accessibility 259
advantages 253
and custom tags 347
constructors 252
containers 252
conventions 252