|
From: JP P. <jp....@ti...> - 2003-06-20 07:39:31
|
Hi Juergen, > BTW, instead of directly setting the respective cookies via JavaScript, > you could make PagedListController implement LocaleResolverAware and the > new ThemeResolverAware. Then the controller could call setLocale/setTheme > in case of respective requests, triggered by certain HTML links. Note that > this implementation strategy allows for seamlessly changing the > LocaleResolver/ThemeResolver implementation, e.g. from the cookie to the > session version! I have some points unclear with this. ----- The Local ResolverAware and ThemeResolverAware interfaces contain only a Resolver setter. This job is made by the ServletDispatcher depending on beans definition. What is needed is getting the Resolver for setting theme or Locale, not setting the Resolver. For now, the Resolvers are put in request Attribute by the ServletDispatcher. They can be found here by the Controller. I really don't see the XXXAware usage. ----- In all cases, it seems a piece of code is for now lacking. JOB: verifying in the request for locale/theme changes and, if needed, calling the Resolver method for setting the new value. You could say, it's straightforward in a Controller. But this will be quite systematically used for applications with theme or locale changes. In addition, if the change is allowed from every page, all Controllers will have to do the same, eventually except if it is handled in ServletDispatcher. The Expert pattern will assign implementation of such code in the Resolver. A new update method could easily be done in the AbstractClass and added in the interface. A static method in an Util Class could be done instead, but we need an extra parameter Resolver in this case. Rests to determine the request parameter to check. Finally, will we be able to call this code from the ServletDispatcher for avoiding calls from each Controller? ----- Jean-Pierre |