SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 156 | Next

Alexander Kolesnikov

"Tapestry 5: Building Web Applications"

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
hotel jelenia góra Russian bride Free English grammar and study guid powiekszenia wielkoformatowe counter strike 1.6