Before
becoming a Java and Unix addicted developer, he gained some experience with
different operating systems. He used OS/2 Warp and Rexx till IBM abandoned it,
then started using Linux (1.x version) in 1996, lately in 2000 he discover the BSD
world and never looked back.
He started working with Java in 1998 just when Java Swing was released with
Java 1.2. Since then he adopted Java for various things??”from GUI applications
to distributed ones. Besides programming, he developed an interest in Unix
programming??”particularly in security issues.
In 2000 he founded his own company DataCode SRL which delivers custom
software solutions.
Table of Contents
Preface 1
Chapter 1: Introduction to Tapestry 7
Why is Tapestry Special? 8
Tapestry HTML Templates are Free from Obtrusive Instrumentation 8
Custom Components are Very Easy to Create 9
AJAX and DHTML, but No JavaScript Coding 10
User Input Validation Works Like Magic 10
Built-In Internationalization Support 10
Inversion of Control Made Easy 11
Is Tapestry the Savior in the World of Java Web Development? 11
The Journey of Tapestry from 3 to 5 13
Summary 15
Chapter 2: Creating Your Working Environment 17
Install a JDK 18
Configuring the Environment for Windows 18
Configuring environment for Mac OS X 21
Install Maven 21
Create a Skeleton Tapestry project 22
Install NetBeans 27
Debugging in NetBeans 33
Installing Eclipse 34
Installing Tomcat 35
Configuring the Project in Eclipse 35
Debugging in Eclipse 44
Summary 46
Table of Contents
[ ii ]
Chapter 3: The Foundations of Tapestry 47
Tapestry Application is a Set of Interactive Pages 48
Page Template and Page Class 49
Using Expansions 51
Using Components 54
Passing a Value Between Pages 59
What Can be Returned From an Event Handler 62
Tapestry Pages are Pooled 63
Making a Page Field Persistent 64
Using Page Activation Context 66
Different Ways of Defining Components 67
Structuring the Application 70
Creating and Using an Application State Object 73
Was an ASO Already Instantiated? 76
Summary 78
Chapter 4: Simple Components 79
Celebrity Collector Project 80
The Auxiliary Classes 81
TextField, PasswordField and PageLink 88
Limiting Access to a Page 94
Loop, Output and DirectLink 96
Another Use of PageLink Component 104
Radio and RadioGroup 105
Using Enumerations for Radio Component Values 109
Prefixes: prop and literal 111
The If and Checkbox Components 112
Submit Component 117
More Than One Submit Button 119
Select Component 120
Configuring an Application State Object 123
Summary 125
Chapter 5: Advanced Components 127
Grid Component 128
Tweaking the Grid 130
Changing the Column Titles 133
Using GridDataSource 135
BeanEditForm Component 139
Tweaking BeanEditForm 142
DateField Component 144
Changing the Styles of Grid and BeanEditForm 147
Table of Contents
[ iii ]
FCKEditor Component 150
Summary 156
Chapter 6: User Input Validation 157
Adding Validation to Components 157
Validators 161
Providing Custom Error Messages 165
Handling Validation-Related Form Events 167
Cross-Form Validation 169
BeanEditForm Validation 173
Summary 173
Chapter 7: Internationalization and Localization 175
Internationalization on the Java Platform 176
Internationalization in Tapestry 176
Creating and Using Message Catalogs 177
Providing a German Message Catalog 181
Switching Locale 182
Internationalization of Images 186
Using Localized Templates 188
Other Examples of Internationalization 189
Summary 192
Chapter 8: Creating Custom Components 195
How to Create a Tapestry 5 Component 196
Creating the Border Component 196
Adding a Navigation Menu 200
Using a Parameter 203
Unleashing the Power of Select Component 205
Creating an OptionModel 206
Creating a SelectModel 208
Creating a ValueEncoder 209
Selecting a Celebrity 210
DateInput Component 211
Making DateInput a Field 217
Adding Simple Validation 220
Creating a Universal Locale Switcher 222
Creating a Custom Service 229
Creating a Library of Custom Components 231
Summary 242
Appendix A: The Basics of Java for the Web 245
The Standard Structure of a Java Web Application 246
The Basics of the Deployment Descriptor 247
Table of Contents
[ iv ]
WAR Files Basics 249
About Java-Enabled Servers 249
Appendix B: Creating a Real Data Source with db4o 251
Preparing the Database 252
The Main Operations 252
The Final Strokes 255
Appendix C: Where to Go Next 259
Index 261
Preface
Tapestry is an open-source framework for creating dynamic, robust, and highly
scalable web applications in Java.
Pages:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25