In practical terms, we
can think that the Web Pages folder in a NetBeans project or the WebContent folder
in Eclipse represents the application context.
In the latter example, if someone wanted to see the flag.gif image, they could do so
by navigating to the URL, www.someserver.com/celebrities/assets/flag.gif.
If, however, context is not mentioned when obtaining an asset, Tapestry will
understand the path to that asset relative to the component class that is requesting it.
In case of our new component, Tapestry will be looking for the image in the images
subfolder located next to the LocaleSwitcher class. So let's first create such a class in
the com.packtpub.celebrities.components package. Here is the code for it, and it
is so simple that no comments are needed:
package com.packtpub.celebrities.components;
import com.packtpub.celebrities.util.LocaleEncoder;
import com.packtpub.celebrities.util.LocaleSelectModel;
import java.util.Locale;
import org.apache.tapestry.SelectModel;
import org.apache.tapestry.ValueEncoder;
import org.apache.tapestry.annotations.Inject;
import org.apache.tapestry.annotations.OnEvent;
import org.apache.tapestry.annotations.Parameter;
import org.
Pages:
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283