From: Trevor C. <tc...@in...> - 2003-02-23 00:48:16
|
>>I've just been confused by your remarks quoted above: The first paragraph >>talks about a setLocale method without a locale parameter, and the third >>paragraph proposes a setLocale method with exactly a locale parameter. What I was proposing was an implementation as follows: public interface LocaleResolver { // get the currently resolved locale Locale getLocale(HttpServletRequest request); // set the locale from the application code void setLocale(HttpServletRequest request, HttpServletResponse response, Locale locale); // resolve the current locale void resolveLocale(HttpServletRequest request, HttpServletResponse response, Locale locale); } >>CookieLocaleResolver.resolveLocale has to look for such a request >>attribute before looking for a cookie. Thus, it will retrieve the >>new locale even if the request still contains the old locale cookie. The problem I see with this is that the application is forced to use whatever method we define in order to change locales. For example, they would be required to have a query parameter like "?locale=frCA". I'm not sure if we are talking about the same thing and not understanding each other, or if we are actually talking about different things. However, I think the only way either of us can be more clear is with working code. You seem to understand the issues, so just code it how you're planning. Worst case, we just refactor any problems later. Trevor D. Cook --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.456 / Virus Database: 256 - Release Date: 2/18/03 |