There will be already a Wicket Session yes.
But if you login then do session.setUser(user) and session.setLocale(databaseUserLocale)

that should work fine. Is that a problem?

On 5/12/06, Bruno Borges <[EMAIL PROTECTED]> wrote:
Just one question:

How to authenticate an user and right after that create a session with a Locale coming from the... database, for example? Remembering that the ISessionFactory is called from the (Custom)WebApplication that has no knowledge about any request, login form... anything.

I think that, the way to set up a default Locale only in the time the Session object is created, it's not good, because sometimes the Session must already exist while the User hasn't authenticated yet. If you guys think in code this feature like the way it's been proposed, there will be no way to inform the ISessionFactory about some things like User info at logon time.

Am I wrong?

On 5/11/06, Eelco Hillenius < [EMAIL PROTECTED]> wrote:
I don't know. That seems to be the original idea of the default
locale, though it never worked. Personally, I don't think such an
option is that great. I would prefer letting you override the session
object - you probably will do that anyway when you have to deal with
things like users etc, and override the getLocale method. That's way
more flexible too, as in that method you can check out the clients
preferred locales, look up database settings and anything else you
might want to do.

Having just one way of doing things attracts more to me, and the
convenience win is minimal for the corner case of fixing a locale for
an application.

Eelco


On 5/11/06, Bruno Borges < [EMAIL PROTECTED]> wrote:
> Wouldn't be useful to have a method that sets a Locale to be used, and if
> this options is setted, Wicket should ignore user's locale?
>
>
> On 5/11/06, Igor Vaynberg < [EMAIL PROTECTED]> wrote:
> >
> > no, the default locale is used when we cannot figure out what the user's
> local is afaik. since the browser is sending a locale that will be used.
> >
> >
> > -Igor
> >
> >
> >
> >
> > On 5/11/06, Bruno Borges < [EMAIL PROTECTED]> wrote:
> > >
> > > Shouldn't these calls override any locale the user is sending at the
> request (from the browser)?
> > >
> > >         getApplicationSettings().setDefaultLocale(new
> Locale("pt", "BR"));
> > >         getResourceSettings().setDefaultLocale(new
> Locale("pt", "BR"));
> > >
> > > I still get english messages, that comes from Application.properties. My
> tought was that, overriding the default locale, I would get portuguese
> messages.
> > >
> > > Regards
> > >
> > >
> > > --
> > > Bruno Borges
> > > [EMAIL PROTECTED]
> > > Sun Certified Java Programmer for 1.4
> > > Sun Certified Web Component Developer for 1.4
> >
> >
>
>
>
>
> --
> Bruno Borges
> [EMAIL PROTECTED]
> Sun Certified Java Programmer for 1.4
> Sun Certified Web Component Developer for 1.4


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmdlnk&kid0709&bid&3057&dat1642
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user



--

Bruno Borges
[EMAIL PROTECTED]
Sun Certified Java Programmer for 1.4
Sun Certified Web Component Developer for 1.4

Reply via email to