René, tapestry also supports locale specific assets (eg images) so a
ComponentRequestFilter is too late in the request-processing pipeline
(http://tapestry.apache.org/request-processing.html).
I think your main problem is that you have contributed your localeFilter
"after:*" so it won't run until after all of the components have rendered
which is pretty useless. If you contribute it "before:*" I assume it would
work.
Also, in your code, I can see a few problems:
1. You have not specified an interface in you bind methods
eg:
public static void bind(ServiceBinder binder) {
binder.bind(TimingFilter.class).withId("TimingFilter");
binder.bind(LocaleRequestFilter.class).withId("LocaleRequestFilter");
}
should be:
public static void bind(ServiceBinder binder) {
binder.bind(RequestFilter.class, TimingFilter.class).withSimpleId();
binder.bind(RequestFilter.class,
LocaleRequestFilter.class).withSimpleId();
}
2. You inject services but never use them
eg:
public void contributeRequestHandler(OrderedConfiguration<RequestFilter>
configuration,
final Logger logger,
final RequestGlobals requestGlobals,
final Cookies cookies,
final LocalizationSetter localizationSetter,
@InjectService("TimingFilter") RequestFilter timingFilter,
@InjectService("LocaleRequestFilter") RequestFilter localeRequestFilter)
{
configuration.add("TimingFilter", new TimingFilter(logger));
configuration.add("LocaleRequestFilter", new
LocaleRequestFilter(requestGlobals, cookies, localizationSetter),
"after:*");
}
should be:
public void contributeRequestHandler(OrderedConfiguration<RequestFilter>
configuration,
final Logger logger,
final RequestGlobals requestGlobals,
final Cookies cookies,
final LocalizationSetter localizationSetter,
@InjectService("TimingFilter") RequestFilter timingFilter,
@InjectService("LocaleRequestFilter") RequestFilter localeRequestFilter)
{
configuration.add("TimingFilter", timingFilter);
configuration.add("LocaleRequestFilter", localeRequestFilter,
"before:*")
}
--
View this message in context:
http://tapestry.1045711.n5.nabble.com/How-to-call-locale-properties-file-based-on-urls-tp5719862p5719871.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]