You should be able to find the
following lines in it:
app
org.apache.tapestry.TapestryFilter
From this we can figure out that the name of the Tapestry filter is app, and so the
name of the root message catalog should be app.properties. Please create such a
file in the WEB-INF directory, and add the following content to it:
Country.Germany=Germany
country.UK=United Kingdom
COUNTRY.USA=United States
Chapter 4
[ 123 ]
I think the logic in which keys are defined is pretty clear. Note that keys are
case-insensitive, and I have intentionally used different case for different options to
show this.
Run the application, and you should see a drop-down list that allows you to select
a country where the labels are displayed exactly as we've defined them in the
message catalog.
We have only one outstanding task for this chapter now, so let's deal with it.
Configuring an Application State Object
Currently, to provide a data source to our pages, we are using an application state
object of type MockDataSource, like this:
@ApplicationState
private MockDataSource dataSource;
When we request such an ASO for the first time, Tapestry takes the specified class
and creates an instance of it using its no-argument constructor (naturally, such a
constructor should exist).
Pages:
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168