|
From: Guillaume P. <gpo...@gl...> - 2004-07-02 13:51:06
|
You could store the request's Locale in a ThreadLocal variable, and = create a DataSource implementation that delegates any call to the real = DataSource according to the current Locale. Guillaume ----- Original Message -----=20 From: Claudio D'Angelo=20 To: spr...@li... ; = spr...@li...=20 Sent: Friday, July 02, 2004 9:16 AM Subject: [Springframework-developer] Change the property of the beans = at request time Hi, I've a problem. In my project I must change the reference in the = application context to request time. This is, I've 4 DataSource: DataSource_it=20 DataSource_es DataSource_en DataSource_mx When a request (web) occours by the user I must get the locale and the = business manager object (beans that extend SqlMapClientSupport) must use = the appropriated DataSource (ie: if the locale is Espana the system must = use DataSource_es for this request). How can I use spring (or other) to resolve this problem.=20 I would want that my business manager is a singleton (if is possible). Thanks Grazie e buon lavoro -------------------------------------------------------------------------= ----- Claudio D'Angelo Software Consultant ObjectWay S.p.A. Via G.A. Boltraffio 7 20159 Milano (MI) http://www.objectway.it --=20 La presente comunicazione potrebbe contenere informazioni riservate = e/o protette=20 da segreto professionale ed e' esclusivamente ai destinatari della=20 medesima qui indicati. Se avete ricevuto per errore la presente = comunicazione,=20 siete invitati a segnalarcelo, rispondendo a questo stesso indirizzo = di e-mail,=20 e a cancellare il presente messaggio dal Vostro sistema. E' = strettamente proibito=20 e potrebbe essere fonte di violazione di legge qualsiasi uso, = comunicazione, copia=20 o diffusione dei contenuti di questa comunicazione da parte di chi la = abbia=20 ricevuta per errore o in violazione degli scopi della presente.=20 Il messaggio e' stato analizzato alla ricerca di virus o contenuti = pericolosi ed=20 e' risultato NON infetto. |