JavaServer Pages

Third Edition Dezember 2003
ISBN 978-0-596-00563-4
Seiten 764
EUR43.00, SFR71.90


Weitere Informationen zu diesem Buch

Inhaltsverzeichnis | Index | Probekapitel | Kolophon | Rezensionen |
Download der Beispiele |


Index

	
[ Symbols ], [ A ], [ B ], [ C ], [ D ], [ E ], [ F ], [ G ], [ H ], [ I ], [ J ], [ K ], [ L ], [ M ], [ N ], [ O ], [ P ], [ Q ], [ R ], [ S ], [ T ], [ U ], [ V ], [ W ], [ X ]

Symbols[ Top ]
\ (backslash), 116
${ (dollar sign-curly brace delimiter), 55, 622
<%--.... --%> (comment scripting element), 50
<%! ... %> (declaration scripting element), 29
<%@...%> (directive scripting element), 50
<%= ... %> (expression scripting element), 29
<% ... %> (scriptlet scripting element), 29
? (SQL parameter placeholder), 183

A[ Top ]
aborting page processing, 168
absolute paths, 349
absolute URIs, 348
Accept headers, 14
Accept-Language header, 236
access control filter class source code, 385
accessor methods, JavaBeans, 405
action classes, Struts, implementing, 394-397
action elements, 51-53, 555-569
      attribute values, setting, 74
      body, processing of, 431-433, 449-453
      <c:import>, 272, 317
      <c:redirect>, 151
      <c:remove>, 221
      <c:url>, 141
      empty element tags, 52
      <fmt:bundle>, 246
      <fmt:formatDate>, 251
      <fmt:formatNumber>, 147, 253
      <fmt:message>, 246
      <fmt:parseDate>, 186, 261
      <fmt:parseNumber>, 261
      <fmt:requestEncoding>, 263
      <fmt:setBundle>, 243-246
      <fmt:setLocale>, 242
      <fmt:setTimeZone>, 252
      <jsp:fallback>, 336
      <jsp:forward>, 128
      <jsp:getProperty>, 61
      <jsp:include>, 317
      <jsp:plugin>, 335
      <jsp:setProperty>, 64-66, 419
      <jsp:useBean>, 186
      <ora:addCookie>, 223
      <ora:ifUserInRole>, 213
      <ora:ifValidEmailAddr>, 203
      <ora:simpleLoop>, 430
      <sql:dateParam>, 187
      <sql:param>, 183
      <sql:query>, 182
      <sql:setDataSource>, 178
      <sql:transaction>, 205
      <sql:update>, 185, 187
      standard actions, 53
      structure, 52
      <x:parse>, 282
      <x:transform>, 273
ActionMapping class, 396
actions
      conditional custom actions, creating, 503
      cooperative actions
            implicit through variables, 476-479
actions
            parent-child cooperation, 473-476
            scripting variables, 479-483
      cooperative custom actions, 473
      custom actions (see custom actions)
      custom I18N actions, 511
      databases, accessing, 172, 182-185
      internationalization, 242
      iteration, implementing, 509-511
      parameter values, accessing with, 83
      runtime errors, 119
      (see also action elements)
add-ons, 20
Apache Ant, 338
Apache JMeter, 364
Apache Struts (see Struts)
APIs (application program interfaces
      Java APIs accessible to JSP, 7
      JNDI, 179
APIs (application program interfaces)
      J2EE APIs, 354
      Java Enterprise APIs, 3
      Java Introspection API, 404
      Java Servlet API (see servlets)
      JDBC (see JDBC)
      JNDI, 532-536
      JSP reference, 628-685
      JSTL (see JSTL)
      tag handlers (see tag handlers)
applet.jsp code, 335
applets, 334
      embedding in JSP pages, 335
application scope, 129, 134
      memory usage considerations, 152
      page hit counters, 138
application variables, 293, 628-632
application-controlled authentication, 214-232
applications (see web applications)
ASP (Active Server Pages), 7
ASP.NET, 8
attribute directive, 548
<attribute> element, 466
attributes
      pageEncoding, 258
      setting, request-time attribute values, 300
      tag files and, 158
      tag handler classes, default values, 458
      (see also actions)
<auth-constraint> element, 211
authenticate( ) method, 396
AuthenticateAction class, 396
authenticate.jsp, 215
authentication, 207
      access control, filters, 383-387
      accessing web resources, 210
      action classes, 394
      application-controlled, 214-232
      containers and, 208-214
      databases, 219
      elements, 211
      filters, 378
      form-based authentication, 209
      HTTP basic authentication, 208
      HTTP client authentication, 209
      HTTP digest authentication, 208
      logging out, 232
      message digests and, 208
      personalized content and, 227
      Tomcat server, 210
      users, 208
authentication.jsp page, 219
authorization, 207
autoFlush attribute, buffering and, 315
automatic type conversions, 66

B[ Top ]
backslash (\), 116
base names, 239
BEA WebLogic, 362
beans (see JavaBeans)
bits, character representation by, 256-259
body-content attribute, tag files, 155
BodyContent class, 651
<body-content> element, 465
BodyTag interface, 442, 652
      methods, 449
BodyTagSupport class, 443, 653
book examples (see examples)
bookmarks, 18
browsers
      redirecting, 224
      URIs and, 348
      View Source command, 110
buffering, 313-315
      autoFlush attribute, 315
business logic, 30

C[ Top ]
Cache-Control header, 340
caching
      preventing, 340
      XML data, 281
calculate.jsp page (internationalization application), 248
CallableStatement, JDBC, 519
      stored procedures, 519
CartBean (online shopping example), 145
case sensitivity, JSP directories and filenames, 47
CATALINA_HOME environment variable, 34
CatalogBean (online shopping example), 144
Caucho Technology Resin, 362
<c:catch>, 571
<c:choose>, 572
centralized request processing, servlets, 387
CERT advisory, cross site scripting attacks, 104
<c:forEach>, 85, 146, 573
      request parameters, online shopping example, 148
<c:forTokens>, 574
CGI (Common Gateway Interface) compared to JSP, 4
character entity codes, custom action conversion of, 159
characters
      representation by bits, 256-259
      URL encoding, 141
charsets, 257
      determining, 263
<c:if>, 575
<c:import>, 272, 317, 575
classes directory, 47
classic tag handler, 442
CLASSPATH environment variable, servlets, compiling, 369
client tier (Enterprise applications), 355
clientscript.jsp page, 327
client/server architecture and the request/response model, 12
client-side code
      generating, clientscript.jsp, 327
      mixing with server-side code, 326
coercion, 624
ColdFusion, 8
comments, 569
comments, JSP, 50
com.ora.jsp.beans.userinfo.UserInfoBean, 90
compilation
      JavaBeans, 409
      servlets, 369
      tag handler classes, 423
components, databases, application specific components, 540
conditional custom actions, creating, 503
ConditionalTagSupport class, 503, 613
confidentiality, 233
config variable, 632
configuration files, Struts, 392
configuration (filters), deployment descriptors, 384
configuration settings, 179
      fallback locale, 512
      locale, 511
      localization context, 512
      maximum rows, 513
      time zone, 512
configuration variables
      internationalization, 243
      setting, 500-502
confirmation.jsp page (employee register application), 173, 188
Connection instance, JDBC, 518
connection pools, 520
      application components and, 529
      database access, 175
      JDBC, 524
      JNDI and, 532-536
      optional packages, 522
      scope variables, 529
ConnectionPool class, 693
Connections, JDBC, 520
ConnectionWrapper class, 525, 694
containers, 26, 354
      authentication and, 208-214
      syntax errors, reporting of, 107
Content-Length headers, 15
contentType attribute, hardcoding, 263
Content-Type headers, 15
Content-Type response header, 373
context parameter value, database access, 177
context path, 349
context paths, 48, 349
contextDestroyed( ) method, 382, 532
contextInitialized( ) method, 381, 531
<context-param> element, 703
context-relative paths, 22, 129
      converting to server-relative paths, 142
      URIs, 350
Controller servlets
      dispatching requests to an action class, 392, 394
      invoking, 399
      mapping application requests, 390
Cookie object, 648
cookies, 135
      creating, custom action example, 426
      deleting, 223
      multiple browser windows, 139
      <ora:addCookie>, 223
      passwords and, 218
      setting, 223
CookieUtils class, 695
<c:otherwise>, 577
country codes, 236
<c:out>, 54, 55, 84, 578
      attribute values for, 85
      debugging, usage in, 116
      param variable, using with, 57
<c:param>, 578
<c:redirect>, 151, 579
<c:remove>, 221, 580
cross site scripting attacks, 104
cross-site scripting attacks
      custom action for protection against, 159
<c:set>, 66, 138, 580
      vs <jsp:setProperty>, 150
<c:url>, 141, 581
currency values, formatting, 147
custom action elements, 29, 69
custom actions, 68, 421, 686-693
      attribute values, converting from text to property type, 497
      body, processing, 431-433, 449-453
      conditional, creating, 503
      cooperating actions, 473
            implicitly through variables, 476-479
            parent-child cooperation, 473-476
            scripting variables, 479-483
      creating, 424-447
      databases, 206
      databases and, 206
      elements, 424
      examples, 425, 445
      I18N, 511
      implementing, 154, 422
      iterating actions, creating, 447-449
      iteration actions, 504-508
      LoopTag interface, 509
      naming of, 156, 169
      output processing, 452
      processing output, 452
      simple, creating, 424-447
      syntax, validating, 487-493
      tag files, compared to, 154
      tag library actions, using, 73
      validating syntax, 487-493
      vs. JavaBeans, 79
custom tag libraries, 68-76
      declaring, 69-72
      developing as tag files, 154-170
      identifying in JSP1.1 containers, 72
      installing, 69
<c:when>, 582

D[ Top ]
data privacy, 233
data types
      automatic conversion, 67
database access, context parameter, 177
databases
      access actions, configuration settings, 513
      accessing, 175
            actions, 172, 182-185
            columns, 191
            drivers for, 176-179
            inserting data, 185
            JavaBeans, 378
      authentication using, 219
      components, application-specific, 540
      custom actions, 206
      date and time formatting, 186
      deleting information, 194
      employee register application, 172
            tables, 174
      entering information, 180
      generic beans, 536
      HTML tables, creating, 189
      input, validating, 201
      Microsoft Access, 175
      MySQL, 175
      numbers, converting from string values, 186
      PostgreSQL, 175
      query results, displaying, 188-191
      query results, multipage
            displaying, 196
            limiting row numbers, 196
            memory considerations, 199
            setting result set size, 196
      relational, 171
            primary keys, 174
      search results, displaying, 193
      searching feature, 192
      TIMESTAMP columns, 186
      transactions, 204
      updating, 187
dataSource attribute, accessing databases, 178
DataSource class, 382
      creating, 176-179
data-source configuration setting, 619
DataSource interface, 175
DataSourceFactory class, 695
DataSourceWrapper class, 526, 696
date and number input form (localization example), 259
date and time formatting
      in databases, 186
      internationalization, 251
DateFormat class, 238
DBCP connection tool implementation, 524
debugging, 114-119
      <ora:debug> custom action, 117
      printing variable values, 114
      Visual Age for Java debugging tool, 114
declarations, 290, 296-299, 553
      variables, 296
            TagExtraInfo class, 483-484
definitions, listeners, 382
DELETE method, 18
delete.jsp page (employee register application), 173, 194
deleting
      cookies, 223
      database information, 194
deployment descriptors, 46, 210
      access control, configuring filters for, 384
      request processing, mapping rules, 390
<description> element, 463, 466, 532, 702
destroy( ) method, HttpServlet class, 367
device-dependent format transformation, XML, 275
directive elements, 28, 48, 547-553
<display> element, 702
<display-name> element, 464
<distributable> element, 364, 703
doAfterBody( ) method
      IterationTag interface, 447, 449
      LoopTagSupport class, 505
doCatch( ) method
      LoopTagSupport class, 506
      TryCatchFinally interface, 456
doEndTag( ) method, 452, 457, 544
      Tag interface, 445
doFilter( ) method, 387
doFinally( ) method, TryCatchFinally interface, 456
doGet( ) method, HttpServlet class, 367
doInitBody( ) method, BodyTag interface, 449
dollar sign-curly brace delimiter (${), 55
doPost( ) method, HttpServlet class, 367
doStartTag( ) method, 457
      IterationTag interface, 448
      LoopTagSupport class, 505
      resetting tag handler state, 459
      Tag interface, 444
doTag( ) method, 422-427, 430
      exceptions, 439
DriverManager, 518
drivers, database access, 176-179
DSN (Data Source Name), 177
DTD (Document Type Definition), XML, 270
dynamic content, 45-57
      ASP (Active Server Pages), development using, 7
      CGI, development using, 4
      ColdFusion, development using, 8
      data sources for, 51
      JSP, development using, 5
      PHP, development using, 8
dynamic values, database access security risks, 184
dynamic-attributes attribute, 158
DynamicAttributes interface, 654
dynamicscript.jsp, 332

E[ Top ]
EIS (Enterprise Information System) tier, 356
EJB containers, 354
EJB (Enterprise JavaBeans)
      entity and session beans, 360
      MVC design model applications, using in, 360
      vs JavaBeans, 354
<ejb-local-ref> element, 719
<ejb-ref> element, 718
EL (Expressioin Language)
      function calls, 56
EL (Expression Language), 30, 54-57, 622-627
      arithmetic operators, 626
      array accessor operators, 626
      bean properties, accessing, 63
      coercion rules, 624
      data types, 624
      dollar sign-curly brace delimiter (${), 55
      empty operator, 627
      expressions, 625-627
      implicit variables, 56, 623
      keywords, 623
      literals, 622
      logical operators, 627
      operand coercion rules, 625
      operators, 55, 625-627
      property operators, 626
      relational operators, 626
      reserved words, 623
      supported data types, 55
      syntax, 622
      syntax errors, 110-114
      types, 681-685
      variables, 56, 623
elements, 69
      custom actions, 424
      syntax errors, 107
      TLD, 463
ELException class, 682
ELParseException class, 682
email addresses, validating, 203
embedded HTML, problems with, xi
embedded servlet containers, 20
employee register application, 172
      tables, 174
EmployeeBean object, 215
enter.jsp page (employee register application), 173
Enterprise JavaBeans (see EJB)
entity beans, 360
<env-entry> element, 718
environment variables, CLASSPATH for compiling servlets, 369
error handling
      attribute names, typos in, 109
      catching exceptions, 124
      exception stack trace, 107
      improperly terminated actions, 108
      missing taglib directives, 110
      runtime errors, 119-124
      syntax errors, 106
            EL syntax errors, 110-114
            element syntax errors, 107
      unterminated elements, 108
error pages, modular applications, 401
ErrorData class, 676
errorData property, 123
errorMsg request parameter, 217
errorPage attribute, 121
<error-page> element, 711
escape characters, 116, 570
event handling, JavaBeans, 406
events, JavaBeans, 404
exact match rule, request processing, 390
<example> element, 467
examples
      installation, 39
      Web application, 40
exception handling, tag handlers, 454-456
exception stack trace, 107
exception variable, 293, 633
exceptions, 124
      TryCatchFinally interface, implementing, 440
executeQuery( ) method, 539
executeUpdate( ) method, 540
ExpressionEvaluator class, 683
expressions, 290, 296, 554
      request-time attribute value, 300
extension rule, request processing, 390
external files, accessing, 374

F[ Top ]
fallback locale, 245
      configuration settings, 512
fallback locale configuration setting, 620
file extension, JSP pages, 45
files
      configuration files, Struts, 392
      external files, accessing, 374
<filter> element, 704
<filter-mapping> element, 705
filters, 359
      access control, 383-387
      authentication, 378
      configuration variables, setting, 500
filters (servlets), 374
findAncestorWithClass( ) method, 474
find.jsp page (employee registration application), 173, 192
<fmt:bundle>, 583
      localization context, 246
<fmt:formatDate>, 583
      internationalization, 251
<fmt:formatNumber>, 147, 585
<fmt:message>, 587
      internationalization, 246
<fmt:param>, 588
<fmt:parseDate>, 186, 261, 589
<fmt:parseNumber>, 261, 590
<fmt:requestEncoding>, 263, 591
<fmt:setBundle>, 591
      internationalization, 243-246
<fmt:setLocale>, 242, 592
<fmt:setTimeZone>, 252, 593
<fmt:timeZone>, 593
fn:contains, 606
fn:containsIgnoreCase, 607
fn:endsWith, 607
fn:escapeXml, 607
fn:indexOf, 608
fn:join, 608
fn:length, 609
fn:replace, 609
fn:split, 610
fn:startsWith, 610
fn:substring, 610
fn:substringAfter, 611
fn:substringBefore, 611
fn:toLowerCase, 612
fn:toUpperCase, 612
fn:trim, 613
<form> element, 82
form-based authentication, 209
forms, 80
forwarding compared to redirection, 151
fragments
      fragment attributes, processing, 162-164, 433-439
      navigation bar, 319
      page fragments, including, 315
FreeMarker template engines, 9
<function-class> element, 467
FunctionInfo class, 664
FunctionMapper interface, 684
<function-signature> element, 468

G[ Top ]
Gefion Software LiteWebServer, 363
generic database beans, 536
generic utility classes, 693-699
GET method, 14
getConnection( ) argument, JDBC, 520
getConnection( ) method, 524, 533
getContextRelativeURI( ) method, 387
getCurrent( ) method
      LoopTag interface, 509
      LoopTagSupport class, 506
getHeader( ) method, 371
getInitParameter( ) method, 381
getLoopStatus( ) method
      LoopTag interface, 509
      LoopTagSupport class, 506
GET method
      POST method, compared to, 17
getName( ) method
      HttpSessionBindingEvent class, 408
getOutputStream( ) method, 374
getParameter( ) method
      request parameters, 371
getParameterMap( ) method, 371
getParameterValues( ) method
      request parameters, 371
getParent( ) method, 474
getPathInfo( ) method, 393
getRedirect( ) method, 398
getRequestDispatcher( ) method, 399
getRequestURI( ) method, 371
getResourceAsStream( ) method, 374
getServletContext( ) method, 374
getServletPath( ) method, 393
getSession( ) method
      HttpSessionBindingEvent class, 408
getter methods, 59
getter methods, JavaBeans, 405
getWriter( ) method, 374

H[ Top ]
hasNext( ) method, LoopTagSupport class, 508
HEAD method, 18
Hello World servlet, 367
hidden fields, state tracking, 137
hit counters, scope and data sharing, 138
Host headers, 14
HTML (Hypertext Markup Language)
      embedded, problems with, xi
      form elements, 80
      formatting of output, 104
      HTML forms login page, 216
      JSP, embedding of active elements using, 5
      XML transformation, 270
HTTP (HyperText Transport Protocol), 11, 12
      basic authentication, 208
      digest authentication, 208
      request messages, 14
      request/response model, 11-18
      response messages, 15
HttpJspPage interface, 677
HTTPS client authentication, 209
HttpServlet class, 367
HttpServletRequest interface methods, 370
HttpServletResponse interface methods, 373
HttpSessionBindingListener interface, 408
HyperText Transport Protocol (see HTTP)

I[ Top ]
I18N custom actions, 511
I18N formatting library, 147
IBM Jikes compiler, 32
IBM Visual Age for Java, 114
<icon> element, 464, 702
IDE (Interactive Development Environments), 45
      for JSP, online listing, 10
IDEs (Interactive Development Environments)
      debuggers, 114
IIS (Internet Information Server) and authentication, 210
<img> elements, 16
implementation
      scriptlets, 293-296
      Struts action classes, 394-397
      tag handler classes, 422
      TryCatchFinally interface, 440
implicit cooperation, actions
      scripting variables, 479-483
      variables, 476-479
implicit objects, scripting elements, 291
implicit variables, 628-647
      coopeative actions, 476-479
      servlet types accessible through, 648-651
import attributes, page directives, 291
importing packages, 291
include directives, 548
      page fragments, 315
indexed properties, JavaBeans, 405
init( ) method, HttpServlet class, 367
initializing shared resources, 380-383
input, 80
      JavaBeans, capture using, 89-92
      localization, 259-263
      non-Western European, 263-267
      validating, 92-104, 132
            using JavaBeans, 99-104
            using JSTL actions, 93-99
            security and, 104
<input> element, 82
input_nw.jsp (localization example), 264
INSERT statement, 185
installating JavaBeans, 409
installating servlets, 369
instance variables, 297
      thread safety, 368
integrity checking, 233
interfaces
      BodyTag, 449
      DataSource, 175
      HttpServletResponse, methods, 373
      HttpSessionBindingListener, 408
      IterationTag, 447
            tag handler class for, 447
      JDBC, 518
      listeners, 375
            JavaBeans, 406
      LoopTag methods, 509
      Servlet, 367
      SimpleTag, 422-433
      SQL statement processing, 176
      Tag, 425, 444
      TryCatchFinally, 454
            methods, 456
internationalization, 234
      Accept-Language header, 236
      actions, 242
      configuration variables, 243
      date and time formatting, 251
      numbers, formatting, 253
      sample application, overview, 239
      (see also localization)
introspection, JavaBeans, 404
Ironflare AB Orion Applica tion Server, 363
ISO-8859 standards, 257
iteration actions, 429, 504-508
      custom, 504-508
      implementing, 509-511
IterationTag interface, 442, 654
      methods, 447
      tag handler for, 447

J[ Top ]
J2EE (Java 2 Enterprise Edition), 353-356
      APIs, capabilities of, 3
      tiers, 355
      Version 1.4 APIs, 354-356
Jakarta
      Commons project, 524
      Taglibs project, 78
      Tomcat server (see Tomcat)
      web site, 32
JAR files, TLDs, 469
      multiple, 472
Java applets, 334
Java IDEs (Interactive Development Environments)
      debuggers, 114
Java Introspection API, 404
Java programmers, xiv
Java SDK (Software Development Kit), 32
      installation, 33
Java servlets (see servlets), 9
JavaBeans, 58-67
      accessing, 131
      classes, 59
      compiling and installing, 409
      components, 30
      database access, 378
      databases, generic beans, 536
      event handling, 406
      event listeners, 378
      initializing, 380
      <jsp:setProperty> action, 419
      listener interfaces, 406
      multithreading, 417-419
      naming conventions, 405-407
      online shopping example, 143
      overview, 403
      package names, 408
      parameter values, capturing, 89-92
      populating, 223
      properties, 58
            setting, 64
      runtime errors, 119
      session events, 408
      types of, 409
      utility beans, 413-417
      value beans, 410-413
      vs. custom actions, 79
      vs Enterprise JavaBeans, 354
javax.servlet.http.HttpServletRequest class, 87
javax.servlet.jsp.ErrorData class, 123
JDBC drivers, 176, 518
      URL, 177
JDBC (Java Database Connectivity), 171, 517
      classes, 518
      Connection instance, 518
      connection pools, 524
            optional packages, 522
      Connections, 520
      driver, directory, 536
      getConnection( ) argument, 520
      interfaces, 518
      setter methods, 519
      statement pooling, 524
      statements, 519
      stored procedures, CallableStatement, 519
Jikes compiler, 32
JMeter, 364
JNDI (Java Naming and Directory Interface), 532-536
      database access, 179
JRE (Java Runtime Environment), 32
j_security_check, 209
j_security_check attribute, 209
JSP actions (see actions)
JSP comments, 50, 569
JSP containers (see containers)
JSP elements, 4, 28-30, 547-570
      action elements, 555-569
      directive elements, 547-553
      scripting elements, 553
      (see also actions)
JSP fragments, 162
JSP (JavaServer Pages), xi, 3-10, 23-31
      advantages, 4-10
            compilation, 6
            division of labor, 6
            Java APIs, integration with, 7
      APIs, 628-685
      CGI compared to, 4
      changes, Version 2.0 specification, xiii
      dynamic content development and, 3
      MVC design model applications, using in, 357-360
      required resources, 10
JSP pages, 45-48
      caching, preventing, 340
      creating, 45
      debugging (see debugging)
      development tools, 45
      HTML output formatting, 104
      installing, 46-47
      MVC model, 131-134
      precompiling, 336-340
      processing, 26
      running, 48
      structure, 25
      tag files, declaration, 156
      writing as XML documents, 342-347
      XML editors, editing with, 75
<jsp:attribute>, 556
<jsp:body>, 556
JspC (JSP Compiler) tool, 338
<jsp-config> element, 711
JspContext class, 655
jspDestroy( ) method, 299
<jsp:doBody>, 557
      JSP fragment invocation, 162
<jsp:doBody> standard action, 161
<jsp:element>, 558
JspEngineInfo class, 677
JspException class, 678
JspFactory class, 679
<jsp:fallback>, 336, 558
<jsp:forward>, 128, 131, 559
JspFragment class, 657
<jsp:getProperty>, 61, 560
<jsp:include>, 317, 560
jspInit( ) method, 299
<jsp:invoke>, 162, 561
<jsp:output>, 561
JspPage interface, 680
<jsp:param>, 562
<jsp:param> elements, 129
<jsp:params>, 563
<jsp:plugin>, 335, 563
<jsp:root>, 565
<jsp:setProperty>, 64-66, 565
      JavaBeans, 419
JspTag interface, 657
JspTagException class, 680
<jsp:text>, 566
<jsp:useBean>, 130, 146, 186, 567
JSTL (JSP Standard Tag Library), xii, 4, 29, 76-78
      action elements (see action elements)
      actions, 54, 571-582
            parameter values, accessing with, 83
            runtime errors, 120
      configuration settings, 619-621
      database access actions, 594-599
      default prefixes, 571
      EL (Expression Language) functions, 606-613
      internationalization and formatting actions, 583-593
      JSTL 1.1 libraries, URIs and prefixes, 76
      JSTL functions, 77
      support and utility types, 613-619
      URIs, 571
      XML processing actions, 599-606
JTA (Java Transaction API), 533

K[ Top ]
keys
      relational databases, 174
keys (Maps), 149
keys (resource bundle files), 238

L[ Top ]
language attribute, page directives, 291
language codes, 236
<large-icon> element, 464
Last-Modified headers, 15
lib directory, 47
libraries
      I18N formatting, 147
      tag, 422
            setting configuration variables, 500-502
lifecycles of servlets, 367-369
LIKE operator (SELECT statement), 193
Linux
      PATH environment variable, 33
      Tomcat server installation, 37
<listener> element, 464, 705
listener interfaces, JavaBeans, 406
listeners, 359
      defining, 382
      JavaBeans, 378
      servlets, 375
      shared resources, initializing, 380-383
      tag libraries, bundling with, 494
list.jsp page (employee register application), 173
ListResourceBundle class, 238
literals
      strings, SQL statements, 183
load-testing web applications, 364
local variables, 297
Locale class, 235-237
<locale-encoding-mapping-list> element, 717
locales
      configuration settings, 511, 620
      number formatting, 147
LocaleSupport class, 614
localization, 234
      Accept-Language header, 237
      default language, 245
      language selection, allowing, 247
      non-Western European input, 263-267
      numbers, formatting, 237
      resources, 238
      sample application, overview, 239
      (see also internationalization)
      text, 238
      user input, 259-263
      using separate pages per locale, 255
localization context configuration settings, 512, 620
LocalizationContext class, 614
logging out, authentication and, 232
login page, HTML forms and, 216
<login-config> element, 211, 716
login.jsp page, 215, 216
      Project Billboard application, 379
longest path prefix rule, request processing, 390
looping, custom iterating actions, 504-508
LoopTag interface, 615
      methods, 509
LoopTagStatus interface, 615
LoopTagSupport class, 504, 616

M[ Top ]
Mac OS X, Tomcat server installation, 37
Macromedia, 9
main.jsp page
      EmployeeBean object and, 215
      Project Billboard application, 380
Maps and keys, 149
maximum rows configuration setting, 513, 621
maxRows attribute, 196
Meerkat news feed, 277
memory
      database query results, keeping in, 199
      release( ) method, 446
      usage considerations, scope and, 152
message digests, 208
<message-destination> element, 720
<message-destination-ref> element, 720
MessageFormat class, 239
method attribute, requests, 17
methods
      BodyTag interface, 449
      configuration variables, 501
      custom iteration actions, 505
      HttpServletRequest interface, 370
      HttpServletResponse interface, 373
      IterationTag interface, 447
      JDBC setter methods, 519
      JSP servlets, 299
      LoopTag interface, 509
      servlets, 367
      setter, SQLCommandBean property, 537
      Tag interface, 425, 444
      TryCatchFinally interface, 456
Microsoft Access, 175
middle tier (Enterprise applications), 355
milestone builds, 34
<mime-mapping> element, 710
Minq Software PureLoad, 364
Model-View-Controller (see MVC)
modular applications
      access control, 383-387
      common error page, 401
      Controller servlet, invoking, 399
      servlets, centralized request processing, 387
      shared resources, initializing, 380-383
multithreading
      JavaBeans, 417-419
      variables and, 297
multivalue properties, JavaBeans, 405
multivalue request parameters, 371
MVC (Model-View-Controller) design model, 30, 356-360
      control, passing from one page to another, 128
      data, passing from one page to another, 129, 131
      overview, 126
      using EJB, servlets, and JSP, 360
      using Jsp, 357
      using servlets and JSP, 358
<my:forEvenAndOdd> custom action, 163
      tag file, 163
<my:htmlFormat> custom action, 160
MySQL, 175

N[ Top ]
<name> element, 465, 466, 467
named fragments, 162
names, configuration settings, 500
naming conventions, JavaBeans, 405-407
navigation bar fragments, 319
New Atlanta ServletExec, 362
NewsBean, personalized content and, 228
NewsItemBean object, 228
next( ) method, LoopTagSupport class, 508
nightly builds, 34
nonces, 208
non-Western European input handling (localization), 263-267
number formatting
      online shopping example, 147
numbers
      converting from string values, databases, 186
numbers formatting
      internationalization, 253
      localization, 237

O[ Top ]
online shopping example, 143-152
      main page code, 145
      number formatting, 147
      redirection compared to forwarding, 151
      request parameters, 148-151
      request processing example, 149
OPTIONS method, 18
<ora:addCookie>, 223, 686
<ora:calendar>, 687
<ora:debug>, 688
<ora:debug> custom action, 117
<ora:fileWrite>, 689
<ora:ifUserInRole>, 213, 689
<ora:ifValidEmailAddr>, 203, 690
<ora:invalidateSession>, 691
<ora:menuItem>, 692
<ora:motd>, 157
<ora:noCache>, 692
<ora:setHeader>, 693
<ora:simpleLoop>, 430
out variable, 293, 633
output formatting, 104
output processing, custom actions, 452

P[ Top ]
package names, JavaBeans, 408
packages, importing, 291
page authors, xiv
page directives, 50, 549
      attributes, 50
      error page definitions, 120
      scripting attributes, 290
      tag files and, 154
page fragments, including, 315
page hit counters, scope and data sharing, 138
page processing, aborting, 168
page scope, 129
      tag files and, 157
page variable, 634
PageContext instance, 635-638
pageContext variable, 292
PageData class, 665
pageEncoding attribute, 258
page-relative paths, 73, 129
      URIs, 350
param variable, 84
      <c:out> and, 57
parameters
      URL encoding, special characters, 141
      values, capturing with beans, 89-92
      values, validating in databases, 203
ParamTag class, parent-child cooperation example, 475
paramValues variable, 85, 86
parent-child cooperation between actions, 473-476
parsing
      dates, localization, 261
      numbers, localization, 261
passwords, cookies and, 218
PATH environment variable, 33
paths
      context paths, 48
      context-relative paths, 129
      page-relative paths, 129
perform( ) method, authentication action class, 395
PermittedTaglibsTLV class, 515
persistence, JavaBeans, 404
personalization, 207
personalized content, 227
      NewsBean and, 228
PHP, 8
PKC (Public Key Certificate), 209
plug-ins, 20
poll.jsp page (internationalization application), 239, 241-248
port 80, 13
POST method, 17
      parameters, valid sessions, 229
      updateprofile.jsp page, 230
POST rmethod
      GET method, compared to, 17
PostgreSQL, 175
Pragma header, 340
precompilation, 27
precompiling JSP pages, 336-340
prepare( ) method, LoopTagSupport class, 508
PreparedStatement, JDBC, 519
presentation, 30
primary keys, 174
processActionForward( ) method, 398
process.jsp page (localization example), 261
process_nw.jsp page (localization example), 266
processPath( ) method, 393
ProductBean (online shopping example), 144
Project Billboard application
      access control, 383-387
      common error page, 401
      component types, 378
      Controller servlet, 399
      servlets, centralized request processing, 387
      shared resources, initializing, 380-383
properties
      JavaBeans, 58, 404
            getter and setter methods, 405
property accessor operator, 57
property editors, 67
PropertyResourceBundle class, 238
PureLoad, 364
PUT method, 18

Q[ Top ]
query results, 188-191

R[ Top ]
<realm-name> element, 211
redirection
      compared to forwarding, 151
relational databases, 171
      primary keys, 174
      (see also databases)
relative paths, URIs, 349
release( ) method, 446
release builds, 34
request messages, 13
request parameters
      getParameter( ) method, 371
      getParameterValues( ) method, 371
      online shopping example, 148-151
request processing, 30
      centralized, servlets, 387
      dispatching to action class, 392-394
      servlets, 379
            mapping to, 390-392
      Struts, 389, 398
request processing page, online shopping example, 149
request processing phase, 27
request property, 87
request scope, 129
request variable, 292, 638-642
RequestDispatcher class, 650
request/response model, HTTP, 11-18
requests, 12, 13-15
      methods, 17-18
      parameters, 16
      reading, 370
request-time attribute values, 55, 157, 300
<required> element, 466
<res-auth>element, 533
resource, 12
resource bundle files, 238
ResourceBundle class, 238
<resource-env-ref> element, 713
<ResourceParams> element, 535
<resource-ref> element, 713
resources
      localization, 238
      shared, initializing, 380-383
      tag handlers, retaining, 460
      web resources, authentication, 210
response headers, 373
response variable, 292, 642-646
responses, 12, 15-16
      generating, 372
      XML, generating, 268
<res-ref-name> element, 532
<res-sharing-scope> element, 533
<res-type> element, 532
Result interface, 618
Result properties, rowCount, 184
result.jsp page (internationalization application), 249
ResultSupport class, 618
<role-name> element, 211
rowCount property, 184
rtexprvalue, 157
<rtexprvalue> element, 466
runtime errors, 119-124

S[ Top ]
scalability, 361-365
scope, 129
      memory usage considerations, 152
      variables
            connection pools and, 529
scoped variables
      accessing, 302
      compared to scripting variables, 302
ScriptFreeTLV class, 514
scripting
      code, scoped variable access, 302
      syntax error examples, 308-312
      syntax error handling, 304-307
scripting elements, 5, 29, 553
      declarations, 296-299, 553
      expressions, 296, 554
      page directive attributes, 290
      scriptlets, 293, 554
      types of, 290
scripting objects, 291
scripting variables compared to scoped variables, 302
scriptlets, 290, 554
      implementing, 293-296
search.html (database application), 192
search.html page (employee register application), 173
searching databases, 192, 193
security
      access control, filters, 383-387
      constraints, definition, 210
      database access risks, 184
      validation and, 104
<security-constraint> element, 211, 714
<security-role> element, 211, 716
SELECT statements (SQL), 182
sendCookie( ) method, CookieUtils class, 426, 446
sendError( ) method, 373, 374
sendRedirect( ) method, 398
server-relative paths, converting to context-relative paths, 142
servers, Controller, 399
server-side code, mixing with client side, 326
server-side data in code, 331
<service-ref> element, 719
Servlet API, 366
servlet contexts, 22
<servlet> element, 706-708
Servlet interface, 367
<servlet-mapping> element, 708
servlets, 19-22, 366
      advantages, 19
      centralized request processing, 387
      compiling, 369
      configuration variables, setting, 500
      context paths, 22
      data sharing among application components, 376
      filters, 374
      Hello World, 367
      installing, 369
      JSP methods, 299
      JSP page implementation class, 26
      lifecycle, 367-369
      listeners, 375
      MVC design model applications, using in, 358
      problems with, 24
      request processing, 379
            dispatching to action classes, 392-394
            mapping to, 390-392
            Struts, 389
      requests, reading, 370
      responses, generating, 372
      servlet containers, 20
      servlet contexts, 21
      Struts
            implementing action classes, 394-397
            request processing, 398
      template engines, 9
      thread safety, 368
      typical servlet class, 23
session beans, 360
session events, JavaBeans, 408
session IDs, URL rewriting, 140
session scope, 129, 134
      memory usage considerations, 152
      page hit counters, 138
session tracking, multiple browser windows, 139
session variable, 292, 646
<session-config> element, 709
sessions
      starting and stopping, 137
      state, tracking, 134-137
      terminating, 232
      valid, checking for, 224
setBodyContent( ) method, 449
setContentType( ) method, 373
setDateHeader( ) method, 341
setLoginCookies( ) method, 396
setPageContext( ) method
      Tag interface, 444
setParent( ) method, 474
setPath( ) method, 397
setter methods, 59
      JavaBeans, 405
      JDBC, 519
setting cookies, 223
setValues( ) method, 539
sharing data
      among application components, 376
      application scope, 134
      <jsp:forward> action, 128
      session scope, 134
<short-name> element, 464
SimpleLoopTag class, 448
SimpleTag interface, 657
SimpleTagSupport class, 658
single-value properties, JavaBeans, 405
SkipPageException class, 681
<small-icon> element, 464
special characters
      URL encoding, 141
SQL (Structured Query Language), 171
      INSERT statement, 185
      processing, classes and interfaces, 176
      SELECT statement, 182
            LIKE operator, 193
      string literals, 183
      transaction processing, 204
      wildcard characters, 193
SQLCommandBean class, 540, 698
SQLCommandBean property setter methods, 537
<sql:dateParam>, 187, 594
SQLException, 539
SQLExecutionTag interface, 619
<sql:param>, 183, 594
<sql:query>, 182, 595
<sql:setDataSource>, 178, 596
<sql:transaction>, 205, 597
<sql:update>, 185, 187, 598
SSL (Secure Socket Layer), 233
SSL-based session tracking, 137
standalone servers, 20
standard action elements, 28
standard actions, 53
startRow attribute, 196
stateless protocols, 12
statement pooling, JDBC, 524
statements
      JDBC, 519
static content, include files, 316
stored procedures, CallableStatement, JDBC, 519
store.jsp page (employee register application), 173, 180
StringFormat class, 697
strings
      literals, SQL statements, 183
      nonces, 208
Struts, 387-401
      action classes, implementing, 394-397
      advantages, 388
      application requests
            dispatching to action class, 392-394
            mapping, 390-392
      configuration file, 392
      JAR file for Struts classes, 397
      request processing, 398
syntax
      validating, custom actions, 487-493
syntax errors, 106
      EL syntax errors, 110-114
      element syntax errors, 107
      scripting, 308-312
            handling, 304-307
      (see also Tomcat, error reporting)

T[ Top ]
tables
      employee register application, 174
      HTML, creating, 189
tag directive, 551
<tag> element, 464
tag extension mechanism, 421
tag files, 68, 154-156
      accessing attribute values using, 157-159
      body-content attribute, 155
      custom actions for body content transformation, 159
      data, exposure through variables, 165
      directory, 155
      JAR files, packaging in, 156
      JSP pages, declaration in, 156
      packaging for reuse, 168
      undeclared attributes, using, 158
      web application structure, placement in, 155
tag handlers
      classic tag handler, 442
      exception handling, 454-456
      state, resetting, 459
      tag handler classes, 70, 421
            conditional actions, 503
            implementing, 422
            lifecycle, 456
            optional attributes, default values for, 458
            output stream handling, 452
            resources, retaining, 460
      tag handler types, 651-664
      TLD, creating, 461
Tag interface, 442, 659
      methods, 425, 444
tag libraries, 52, 422
      configuration variables, setting, 500-502
      generic validators, 514
      listeners, bundling, 494
tag scope, 157
TagAdapter class, 661
TagAttributeInfo instance, 665
<tag-class> element, 465
TagData instance, 666
tagdir attribute, 156
TagExtraInfo class, 667
      custom action syntax, validating, 493
      declaring variables, 483-484
<tag-file> element, 467
TagFileInfo class, 669
TagInfo instance, 669
taglib directives, 50, 52, 470, 551
      internationalization application, 242
      missing directives, 110
TagLibraryInfo instance, 671
TagLibraryValidator class, 488, 673
      custom action syntax, validating, 487-493
taglibs
      Jakarta Taglibs project, 78
TagSupport class, 443, 662
TagVariableInfo instance, 674
target page, MVC model, 128
template engines, 9
template text, 26, 51
thread safety, servlets, 368
time and date formatting
      databases, 186
      internationalization, 251
time zone settings, 252, 512, 621
TIMESTAMP columns, databases, 186
TLDs (Tag Library Descriptors), 69, 168-170, 422
      creating, 461
      custom action syntax, validating, 488
      elements, 463
      JAR files, 469
            multiple libraries, 472
      PermittedTaglibsTLV validator, 515
      ScriptFreeTLV validator, 514
      source code, 423
      Version 1.1 compared to Version 1.2, 469
<tlib-version> element, 464
Tomcat, 32
      authentication and, 210
      binary distribution, download web site, 34
      error reporting, 107-114
            EL syntax, 111
            missing curly braces, 111
            missing end curly brace, 111
            misspelled property names, 112
            syntax errors, 107
      implementation class storage, 337
      installation directories, 37
      JspC tool, 338
      Server Configuration Reference, 535
      server installation, 33
            Unix, Linux and Mac OS X, 37
            Windows, 34-36
      testing, 37
            proxy settings, adjustment, 38
      Version 5, 32
      version builds, 34
TRACE method, 18
transactions, 204
translation phase, 27
translation time types, 664-676
TryCatchFinally interface, 442, 454, 663
      methods, 456
<type> element, 466
typos (see syntax errors)

U[ Top ]
Unicode, 257
Uniform Resource Identifiers (see URIs)
Uniform Resource Locators (see URLs)
Uniform Resource Names (see URNs)
Unix
      PATH environment variable, 33
      Tomcat server installation, 37
updateprofile.jsp page, 227, 230
updating databases, 187
<uri> element, 464
URIs (Uniform Resource Identifiers), 13
      access control with, 383
      interpreting, 348-350
URLs (Uniform Resource Identifiers), 13
URLs (Uniform Resource Locators), 13
      encoding of special characters, 141
      encoding, session tracking, 140
      JDBC drivers, 177
      URL rewriting, 135
            multiple browser windows, 139
            session IDs, 140
      URL-encoding, 17
URNs (Uniform Resource Names), 13
user authentication, 208
      form-based authentication, 209
      HTTP basic authentication, 208
      HTTPS client authentication, 209
      list.jsp code, 212
      <ora:ifUserInRole> action, 213
      personalized content, 227
User Info application, parts of, 127
user input, 80
      databases, validating, 201
      JavaBeans, capture using, 89-92
      localization, 259-263
      non-Western European input
            handling, 263-267
      validating, 132
      validation, 92-104
            using JavaBeans, 99-104
            using JSTL actions, 93-99
            security and, 104
User-Agent headers, 14
userinfoinput.jsp page, 131
usernames, cookies and, 218
utility beans, 409, 413-417

V[ Top ]
valid sessions, checking for, 224
validate.jsp page (employee registration application), 173, 201
validation
      database input, 201
      user input, 132
validation object, 222
validation page, 132
ValidationMessage instance, 675
<validator> element, 464
validators, tag libraries, 514
value beans, 409, 410-413
valueBound( ) method, 408
valueUnbound( ) method, 408
var attribute, accessing databases, 178
variable directive, 552
<variable> element, 465
VariableInfo instance, 675
VariableResolver interface, 684
variables
      application, 293
      CLASSPATH environment, compiling servlets, 369
      configuration
            internationalization, 243
            setting, 500-502
      declaring, 296
            TagExtraInfo class, 483-484
      exception, 293
      export of data to pages using, 165
      implicit variables (see implicit variables)
      instances, thread safety, 368
      JavaBeans, accessing, 131
      out, 293
      pageContext, 292
      request, 292
      response, 292
      scope variables, connection pools, 529
      scripting, cooperative actions, 479-483
      session, 292
Velocity template engine, 9
VeriSign, 233
View Source command, browsers, 110
Visual Age for Java, 114

W[ Top ]
WARs (Web Application Archives), 21, 46
      creating files, 721
Web Application Archives (see WARs)
web applications, 11-18, 46
      access control, 210, 383-387
      centralized request processing, 387
      common error pages, 401
      components, sharing data among, 376
      context paths, 48, 349
      databases and, 171
      databases, custom actions, 206
      deployment descriptors, 701-722
            example, 721
      design, importance of, 106
      design models, 353-365
            scalability, 361-365
      directory structure
            tag files placement in, 155
      distributable, 362
            marking as, 364
      employee register database, 172
            tables, 174
      file structure, 700
      HTTP and, 11
      initializing shared resources, 380-383
      internationalization, 235
      invoking Controller servlets, 399
      J2EE (Java 2 Enterprise Edition) design model, 353-356
      JSP, developing with, xi
      load-testing, 364
      MVC (Model-View-Controller) design model, 30, 356-360
            using EJB, servlets, and JSP, 360
            using JSP, 357
            using servlets and JSP, 358
      Project Billboard, selecting component types, 378
      security, 209
      separating functions of, 126
      servlet context and, 22
      Tomcat, installation using, 39
      typical structure, 21
      URI path prefix, 22
      XML and, 268
      XML application, 269
      XSLT and, 271
web containers, 27, 354, 363
      differences between, 340
      DSNs and, 177
      error reporting by, 110
      example code and, 39
      inclusion in IDEs, 45
      Java Virtual Machines and, 364
      JNDI support, 532
      JSTL support, 77
      load balancing modules, 362
      locale information and the pageContext object, 237
      memory demands of, 361
      servlet lifecycles and, 367-369
      tag files and, 154
      tiers and, 355
web resources, access authentication, 210
web sites
      charsets (ISO-8859), 257
      country codes (ISO 3166), 236
      J2EE Blueprint papers, 409
      JDBC drivers, 176
      language codes (ISO 639), 236
      Unicode, 257
WEB-INF directory, 41, 47
      case sensitivity, 47
web.xml, 47
<welcome-file-list> element, 710
Windows
      PATH environment variable, setting, 33
      Tomcat server installation, 34-36
            "Out of environment space" message, 36
WML phone book JSP page code, 269
WML (Wireless Markup Language), 269
wrapper classes, 525

X[ Top ]
<x:choose>, 599
<x:forEach>, 600
<x:if>, 601
XML (Extensible Markup Language), 268
      applications, 269
      authentication and, 210
      caching and, 281
      data processing, 277
      declarations, 270
      device-dependent format transformation, 275
      documents, writing JSP pages as, 342-347
      DTDs, 270
      responses, generating, 268
      transforming to HTML, 270
<x:otherwise>, 601
<x:out>, 602
<x:param>, 602
<x:parse>, 282, 603
XPath expressions, 283-289
<x:set>, 604
XSL (Extensible Stylesheet Language), 270
<xsl:for-each> element, 274
XSLT (Extensible Stylesheet Language Transformations), 271
      HTML table generation, 274
<xsl:template> element, 274
<xsl:value-of> element, 274
<x:transform>, 273, 604
<x:when>, 605

	

Zurück zu JavaServer Pages


Themen

Buchreihen

Special Interest

International Sites

O'Reilly China O'Reilly France O'Reilly USA O'Reilly Japan O'Reilly Taiwan