Anton Veretennikov wrote:
May be cookie?

You can also try to extract the locale used by user in the browser from request header:

http://www.acegisecurity.org/guide/springsecurity.html#concurrent-sessions

GET /guide/springsecurity.html HTTP/1.1
Host: www.acegisecurity.org
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.6) 
Gecko/2009011913 Firefox/3.0.6
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: pl,en;q=0.7,en-us;q=0.3
                   ^^^^^
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-2,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: http://www.acooke.org/cute/SessionLim0.html
If-Modified-Since: Tue, 15 Apr 2008 17:18:26 GMT
If-None-Match: "28002-5ba09-44aec96961c80"
Cache-Control: max-age=0

HTTP/1.x 304 Not Modified
Date: Fri, 06 Mar 2009 11:52:59 GMT
Server: Apache/2.2.8 (EL)
Connection: close
Etag: "28002-5ba09-44aec96961c80"

Spring can resolve locale for you in a flexible manner:

http://static.springframework.org/spring/docs/2.0.x/api/org/springframework/web/servlet/LocaleResolver.html

in your case:

http://static.springframework.org/spring/docs/2.0.x/api/org/springframework/web/servlet/i18n/AcceptHeaderLocaleResolver.html

To integrate wicket with spring in this context override WebApplication.newSession:

@Override
public Session newSession( Request request, Response response ) {
        return new WebSession( request ) {
                @Override
                public Locale getLocale() {
                        return LocaleContextHolder.getLocale();
                }
        };
}


--
Leszek Gawron

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to