I answer Matthew's question on IRC today, but for the list:
>From the HttpServletRequest, call
getAttribute("DefaultComponentManager") and then do:
dcm.init(something)
where something is an object that implements some Aware interfaces.
-Pat
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Matthew E. Porter
Sent: Thursday, November 20, 2003 5:23 PM
To: [EMAIL PROTECTED]
Subject: [OS-webwork] Accessing IoC components
I have a SessionProvider component configured with XW's IoC. This
class provides a Hibernate Session for use and is dependent upon some
other components. This seems to work perfectly. Yet, my problem is
occurring when I want to use the same SessionProvider component with a
non-IoC component. Specifically, I would like to use the session
provided by SessionProvider for custom Hibernate DAOs.
My first attempt thought was to access the component manager via
ActionContext.getContext().get("com.opensymphony.xwork.interceptor.compo
nent.ComponentManager") and initialize the object; however, the
ActionContext is returning null.
Any ideas?
Cheers,
matthew
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork