Beginning JSP, Jsf and Tomcat Web Development [1 ed.] 9781590599044, 1590599047

Start building Java-based web applications now, even if you're a complete newcomer to Java. Comprehensive and examp

244 115 5MB

English Pages 472 Year 2007

Report DMCA / Copyright

DOWNLOAD PDF FILE

Table of contents :
Beginning JSP™, JSF™, and Tomcat Web Development:......Page 1
Contents at a Glance......Page 5
Contents......Page 7
About the Authors......Page 19
About the Technical Reviewer......Page 21
Introduction......Page 23
Introducing JavaServer Pages and Tomcat......Page 25
What Is JSP?......Page 26
Viewing a JSP Page......Page 27
Hello World!......Page 29
The Model 1 Architecture......Page 33
The Model 2 Architecture......Page 34
The Ebookshop Home Page......Page 36
The Ebookshop Servlet......Page 39
More on Ebookshop......Page 42
What Role Does Tomcat Play in All This?......Page 45
Summary......Page 48
Introduction......Page 49
Data Types and Variables......Page 50
Objects and Arrays......Page 52
Operators, Assignments, and Comparisons......Page 53
Selections......Page 54
Iterations......Page 55
Books......Page 56
The Customer Interface......Page 57
Servlet Initialization......Page 59
The View......Page 61
Implicit Variables......Page 62
Implicit Variable: out......Page 63
Implicit Variable: request......Page 64
Implicit Variable: session......Page 65
Directive: include......Page 66
Actions: forward, include, and param......Page 67
Actions: useBean and setProperty......Page 69
Comments and Escape Characters......Page 71
Step 1: Define the Tag Handler......Page 72
Step 2: Define the TLD......Page 74
Bodied Custom Actions......Page 76
Step 1: Define the Tag Handler......Page 77
Step 2: Define the TLD......Page 78
JSP Expression Language......Page 79
Using EL Expressions......Page 80
JSP Standard Tag Library......Page 83
The Core Library: Listing the Parameters......Page 84
Other Core Tags......Page 86
The i18n Library: Writing Multilingual Applications......Page 87
Introduction to XPath......Page 90
A Practical Example......Page 91
XML Syntax......Page 93
Summary......Page 96
The Protocols......Page 97
The Formatting......Page 99
More Bits and Pieces......Page 100
URLs......Page 101
Hosts and Paths......Page 102
GET and POST Requests......Page 103
Validation......Page 104
Document Structure and Basic Elements......Page 105
Content: Text, Objects, and Links......Page 106
Tables......Page 108
Forms......Page 111
Cascading Style Sheets......Page 117
Style Syntax......Page 118
Putting It All Together in an Example......Page 120
JavaScript......Page 124
Responding to Events......Page 125
Checking and Correcting Dates......Page 126
Animation: Bouncing Balls......Page 131
Animation: Ticker Tape......Page 138
What’s Ajax?......Page 140
Summary......Page 143
Database Basics......Page 145
SQL Scripts......Page 148
Java API......Page 150
Getting Started......Page 151
The executeQuery Method......Page 152
Transactions......Page 154
DB Access in Eshop......Page 155
What About the XML Syntax?......Page 159
Possible Alternatives to MySQL......Page 164
Summary......Page 167
At Face Value (JSF Primer)......Page 169
The JSF Life Cycle......Page 170
JSF Custom Tags......Page 172
Event Handling......Page 173
The JSF Application......Page 174
f:view, h:form, and h:outputText......Page 175
f:subview, h:panelGroup, h:graphicImage, and h:commandLink......Page 177
h:panelGrid, h:inputText, and h:commandButton......Page 178
The Shop Manager......Page 180
h:dataTable and h:column......Page 182
f:facet......Page 183
h:message and f:verbatim......Page 184
Using and Creating Converters......Page 185
Writing the Converter in Java......Page 186
Using and Creating Validators......Page 188
Built-In Validators......Page 189
Application-Level Validation......Page 190
Custom Validators......Page 191
Creating Custom Components......Page 193
Component......Page 194
Renderer......Page 196
Tag......Page 198
web.xml......Page 202
Summary......Page 204
Communicating with XML......Page 205
The XML Document......Page 206
XML DTDs......Page 207
XML Schemas......Page 208
Primitive and Derived Types......Page 210
Simple Types......Page 211
Complex Types......Page 214
Validation......Page 215
Validation Against a DTD......Page 217
Validation Against a Schema......Page 220
Example 1: Transformation from One XML Format to Another......Page 222
Example 2: Transformation from XML to HTML......Page 224
Browser Side vs. Server Side......Page 225
SOAP......Page 228
Summary......Page 234
Tomcat’s Architecture and server.xml......Page 235
Connector......Page 237
Host......Page 238
Listener......Page 239
Realm......Page 240
Valve......Page 241
conf......Page 242
webapps......Page 243
Example: Logging the Requests......Page 244
Example: Creating a Virtual Host......Page 247
Example: HTTPS......Page 248
Application Deployment......Page 250
Summary......Page 252
The Eshop Application......Page 253
What Happens When the Application Starts......Page 255
Displaying the Book Details......Page 258
Managing the Shopping Cart......Page 259
The Eshopx Application......Page 260
Style Sheet......Page 261
JSP Documents......Page 263
Custom Tags and TLD......Page 266
The Eshopf Application......Page 268
web.xml and context.xml......Page 270
JSP Documents......Page 271
Java Modules......Page 272
Summary......Page 274
Java......Page 275
Tomcat......Page 278
MySQL......Page 279
JDBC......Page 280
Tomcat and MySQL Checks......Page 281
JSTL......Page 284
XPath......Page 286
JavaServer Faces......Page 288
HTML Characters......Page 289
id......Page 297
accesskey......Page 298
to ......Page 299

and ......Page 300
Character Styling......Page 301
......Page 302
......Page 303
......Page 304
Creating a Clickable Map......Page 305
......Page 307
Frames......Page 308
frameborder......Page 309
cols......Page 310
......Page 311
......Page 313
accept......Page 315
Text Input......Page 316
Buttons and Images......Page 318
Choices......Page 319
Sets of Fields......Page 320
Lists......Page 321
The element......Page 322
usemap......Page 323
More on Image Maps......Page 324
align, char, and charoff......Page 325
Attributes......Page 326
border, frame, and rules......Page 327
colspan and rowspan......Page 328
headers......Page 329
Columns......Page 330
Column Groups......Page 331
Table Header, Body, and Footer......Page 332
and ......Page 333
and ......Page 334
and ......Page 337
Implicit Objects......Page 339
Example: Using an Attribute to Enable and Disable Conditional Code......Page 340
Example: Using an Attribute to Control Logging......Page 341
Example: Using an init Parameter to Increase Application Portability......Page 343
The exception Object......Page 344
The out Object......Page 345
The pageContext Object......Page 346
Example: Listing the Headers......Page 347
Example: User Authentication......Page 349
Example: Reading the Request Body......Page 351
Example: Getting the Parameters......Page 353
The session Object......Page 355
The page Directive......Page 356
Standard Action Elements......Page 358
jsp:element, jsp:attribute, and jsp:body......Page 359
jsp:forward and jsp:param......Page 360
jsp:include......Page 361
jsp:plugin, jsp:params, and jsp:fallback......Page 362
jsp:useBean, jsp:getProperty, and jsp:setProperty......Page 364
Syntax......Page 367
Unknown......Page 0
Declarations......Page 369
SQL Terminology......Page 371
Transactions......Page 372
Statements......Page 374
The WHERE Condition......Page 375
Numbers......Page 377
Date and Time......Page 378
Large Objects......Page 379
SELECT......Page 380
SELECT to Obtain Data......Page 381
SELECT to Apply a Function......Page 382
JOINs......Page 383
CREATE DATABASE......Page 385
CREATE TABLE......Page 386
CREATE VIEW......Page 388
INSERT......Page 389
ALTER TABLE......Page 390
UPDATE......Page 391
Reserved SQL Keywords......Page 392
f:actionListener......Page 395
f:convertDateTime......Page 396
f:convertNumber......Page 397
f:loadBundle......Page 398
f:phaseListener......Page 399
f:selectItems......Page 400
f:validateDoubleRange......Page 401
f:validator......Page 402
f:view......Page 403
h:commandButton......Page 404
h:dataTable......Page 405
h:form......Page 406
h:inputSecret......Page 407
h:inputTextarea......Page 408
h:outputFormat......Page 409
h:outputText......Page 410
h:panelGroup......Page 411
h:select*......Page 412
h:selectBooleanCheckbox......Page 413
h:selectManyCheckbox......Page 414
h:selectManyListbox......Page 415
h:selectManyMenu......Page 416
h:selectOneMenu......Page 417
h:selectOneRadio......Page 418
Shared Attributes......Page 419
Eclipse......Page 425
How to Install Eclipse......Page 426
Importing the Eshop* Projects into Eclipse......Page 427
The Project Explorer Sidebar......Page 431
Eclipse Errors in Error Reporting......Page 432
Eclipse’s Main Window......Page 434
How to Make a WAR File......Page 436
Abbreviations and Acronyms......Page 439
Index......Page 443

Beginning JSP, Jsf and Tomcat Web Development [1 ed.]
 9781590599044, 1590599047

  • 0 0 0
  • Like this paper and download? You can publish your own PDF file online for free in a few minutes! Sign Up
File loading please wait...
Recommend Papers