I develop an Struts application using hibernate.
I use Struts processor to open a session for each client request.
I use hibernate event mechanism to be notified when an object is inserted.
I need to send an email to some people when an event occurs.
This email contains i18n message according to the Locale presents in his HTTPSession.
My problem is that when I receive a notification, the notification event does not known what a HTTPSession is (of course ;-) ).
So can I put the Locale in the Hibernate Session or Transaction (or everything else) to allow me to do something like that :
Code:
Locale userLocale = session.getCustomParameter("locale");
And use the struts processord to do something like :
Code:
session.setCustomParameter(locale);