[ http://issues.apache.org/jira/browse/WICKET-151?page=comments#action_12456657 ] Eelco Hillenius commented on WICKET-151: ----------------------------------------
I think it is confusing how it is now. It's not obvious how/ when the locale is set, so the user would have to know that piece of code in WebApplication. But as Wicket does set it (not optional) I think it needs a tighter contract so that it is obvious the locale is provided by the framework right away, gives the user to actually do something with it (now he/ she would have to do that 'lazily') and so that the whole action is kind of atomic. I agree with making getLocale final btw, and in fact I think I remember final was removed there to make this pinning of the locale possible in the first place. > set session locale when constructing session object > --------------------------------------------------- > > Key: WICKET-151 > URL: http://issues.apache.org/jira/browse/WICKET-151 > Project: Wicket > Issue Type: Improvement > Affects Versions: 2.0, 1.3 > Reporter: Eelco Hillenius > Assigned To: Eelco Hillenius > Fix For: 2.0, 1.3 > > > Currently, we create the session objects like this: > WebApplication#getSession: > if (session == null) > { > // Create session using session factory > session = getSessionFactory().newSession(request); > // Set the client Locale for this session > session.setLocale(request.getLocale()); > What I propose is to change the constructor from Session/ WebSession to take > in a Locale parameter as well. That would make it possible for custom session > classes to fix the locale by setting it in the constructor. Now that is only > possible by overriding Session#getLocale -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
