Enjoying Web Development with Tapestry 5
Table of Contents
Foreword......................................................................................................................................3
How to create web-based application easily?..........................................................................3
How this book can help you learn Tapestry?...........................................................................3
Unique contents in this book....................................................................................................4
Target audience and prerequisites..........................................................................................4
Acknowledgments....................................................................................................................4
Chapter 1 Getting Started with Tapestry....................................................................................11
What's in this chapter?..........................................................................................................12
Developing a Hello World application with Tapestry..............................................................12
Installing Eclipse....................................................................................................................12
Installing Tomcat....................................................................................................................12
Installing Tapestry..................................................................................................................14
Creating a Hello Word application.........................................................................................14
Generating dynamic content..................................................................................................21
Disabling caching in Tapestry................................................................................................25
Making changes to Java code take effect..............................................................................26
Other ways to set the value...................................................................................................27
Debugging a Tapestry application.........................................................................................27
Summary...............................................................................................................................30
Chapter 2 Using Forms..............................................................................................................31
What's in this chapter?..........................................................................................................32
Developing a stock quote application....................................................................................32
Creating the result page........................................................................................................38
Displaying the Result page in the listener..............................................................................38
Easier way to get access to another page.............................................................................41
Instance variables may breach security.................................................................................41
Using Java annotations to inject pages and properties.........................................................45
Using implicit components.....................................................................................................47
Using a combo box................................................................................................................48
Using the DatePicker.............................................................................................................49
Using the API doc..................................................................................................................52
Using the component reference.............................................................................................55
Summary...............................................................................................................................56
Chapter 3 Validating Inputs........................................................................................................57
What's in this chapter?..........................................................................................................58
Postage calculator.................................................................................................................58
Accepting integer inputs........................................................................................................60
What if the inputs are invalid?...............................................................................................62
Using validators.....................................................................................................................69
What if the translator can't translate the string?....................................................................72
Handling null inputs...............................................................................................................72
Setting the display message..................................................................................................73
Using a FieldLabel.................................................................................................................74
Creating your own validator...................................................................................................75
Showing all the errors............................................................................................................77
Using informal parameters.....................................................................................................80
Performing validation using Javascript..................................................................................81
评论0
最新资源