I'm trying intercept an object contrsuction where I don't control the caller object so dependencies can be injected that would normally when the caller gets the object via spring (in a web application via the httphandler)
Specifically: I have a BO that is injected into an aspx that gets data from the DAO.The BO is injected with the DAO and all is fine.
However if I use an <asp:ObjectDataSource .../> that calls the BO, a new instance of the BO is created by <asp:ObjectDataSource ../> without an injected DAO.
I've tried this (which doesn't work)
Does anyone have suggestions on how to intercept MyBo's constructor and inject the required DAO?
<object name="MyBo" type="Namespace.MyBo, App_Code">
<property name="MyDao" ref="MyDao" />
<object name="MyBoSingleton" type="Spring.Aop.Target.SingletonTargetSource">
<constructor-arg name="target" ref="MyBo" />