I hope you do not mind that I am constantly switching between different
ways of defining Tapestry components. I do this intentionally, to give you
an opportunity to choose which one you prefer.
The final step is to actually create the boolean property named userExists. Add the
following lines of code to Start page class:
private boolean userExists;
public boolean getUserExists()
{
return userExists;
}
The Foundations of Tapestry
[ 78 ]
This time when you run the application initially, there should be no user information
on the Start page. However, as soon as you either submit a new name for the user (in
which case the User ASO will be requested by the Start page) or simply click on the
Go to Another page link (in which case the ASO will be requested by the Another
page), the ASO will be instantiated. As a result, when you visit the Start page next
time, you will see the user information displayed there.
Now you know almost everything there is to know about using Application State
Objects, and certainly enough to begin using them in your applications. Let's now see
what we have learned in this chapter.
Summary
We have covered a lot of ground in this chapter, and as a reward, you should have
by now a strong feeling that you know how to work with Tapestry.
Pages:
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112