Table of Contents
1 INTRODUCTION
1.1 CLICK: THE BIG PICTURE
1.1.1 Component based
1.1.2 Pages and controls
1.2 WHO SHOULD READ THIS BOOK
1.2.1 What you should already know
1.2.2 Is Click right for you?
1.3 HOW THIS BOOK IS ORGANIZED
1.3.1 Getting the source code
2 HELLO, CLICK!
2.1 SETTING UP A CLICK APPLICATION
2.1.1 Installing Maven
2.1.2 The pom.xml file
2.1.3 The web.xml file
2.1.4 The index.html file
2.2 HELLO, CLICK
2.2.1 The click.xml file
2.2.2 The Page class
2.2.3 The Velocity template
2.3 RUNNING THE EXAMPLE
3 VELOCITY IN EIGHT MINUTES
3.1 MERGING A CONTEXT WITH A TEMPLATE
3.2 VARIABLE REFERENCES
3.3 DIRECTIVES
3.3.1 Setting a variable
3.3.2 Branching
3.3.3 Looping
3.4 MACROS
3.5 COMMENTS
3.6 INCLUDING OTHER FILES
3.7 DYNAMICALLY DYNAMIC CODE
3.8 HALT!
4 A TOUR OF OUR PROJECT
4.1 WELCOME TO CLICK POLL
4.2 REGISTERING AND LOGGING IN
4.3 CREATING POLLS
4.4 MODERATOR TASKS
4.4.1 User roles
5 PAGE LAYOUTS AND MENUS
5.1 READY, SET, GO!
5.2 CREATING A REUSABLE PAGE LAYOUT
5.2.1 Using the layout
5.2.2 Why that works
5.3 ADDING A CASCADING STYLE SHEET
5.4 USING MENUS
5.4.1 Introducing Click Extras
5.4.2 Defining the menu
5.4.3 Rendering the menu
5.4.4 Styling the menu
5.4.5 Why that works
6 STACKING THE DECK
6.1 SETTING UP A DATABASE
6.2 CREATING A PERSISTENCE LAYER
6.2.1 Setting up a JPA persistence unit
6.2.2 Setting up Spring and Hibernate
6.2.3 Creating a DAO
6.3 CREATING MODEL CLASSES
6.4 TESTING OUR PERSISTENCE LAYER
6.5 INTEGRATING SPRING WITH CLICK
7 CREATING FORMS
7.1 CREATING THE REGISTRATION FORM
7.2 VALIDATING INPUT
7.2.1 Method chaining
7.2.2 Required fields
7.2.3 Minimum and maximum length
7.2.4 JavaScript validation
7.2.5 Custom validation
7.2.6 Using a flash message with a redirect
7.3 CUSTOMIZING THE FORM LAYOUT
8 AUTHENTICATION AND AUTHORIZATION
8.1 IMPLEMENTING A LOGIN MECHANISM WITH APACHE SHIRO
8.1.1 Installing Apache Shiro
8.1.2 Setting up a realm
8.1.3 Configuring Shiro in web.xml
8.1.4 Implementing the login form
8.1.5 Logging out
8.2 USING ROLES
9 EXPLORING MORE CONTROLS
9.1 CREATING TABLES
9.1.1 Creating a simple table
9.1.2 Table style classes
9.1.3 Sorting and paging
9.2 ADDING LINKS
9.2.1 Adding a value to a link
9.2.2 Adding a JavaScript confirmation
9.3 VOTING
9.4 REMOVING POLLS
10 CONCLUSION
INDEX