-
1. Re: Emailing From ActionHandler
brittm Jan 6, 2006 4:44 PM (in response to tobysaville)What about binding your e-mail class to JNDI and then doing a JNDI lookup in your action handler?
-Britt -
2. Re: Emailing From ActionHandler
tobysaville Jan 8, 2006 1:07 PM (in response to tobysaville)Thanks for your suggestion Britt, that is definitely a good option.
How about if the email singleton is bound to our Spring WebApplicationContext, not to the tomcat ApplicationContext as previously stated, and I would prefer to retrieve it from here instead of from JNDI?
Thanks again,
toby -
3. Re: Emailing From ActionHandler
enazareno Jan 10, 2006 7:48 PM (in response to tobysaville)Hi Toby,
If you dont have a solution yet and don't want to mess around with jndi, you can do this. In your servlet that creates or retrieves the process instance, get the handle of you mail service and place it in the context variable. Since variables are global to a process instance, you can already access that anywhere in your action handlers. Afterwards, remove the variable so it wont be saved in the database. (note: I tried transient variables but it doesn't seem to work, try normal variables instead)
Regards,
Elmo