Lado
03-29-2007, 08:54 PM
Hi All,
I am a new member of the forum. Our team at the place of work is trying to use Spring.Net in our developement and I've been reading the docuemtataion and playing with examples/tutorials provided therein.
I have a very simple web app to which I added project for my business object. I want to use DoI in the business object (project) tier as a proof of concepts for my team but I run to problem.
I basically defined my objects in App.config file in the same name space as my business object tier is, as follows:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="spring">
<section name="context" type="Spring.Context.Support.ContextHandler, Spring.Core"/>
<section name="objects" type="Spring.Context.Support.DefaultSectionHandler, Spring.Core"/>
</sectionGroup>
</configSections>
<spring>
<context>
<resource uri="config://spring/objects"/>
</context>
<objects xmlns="http://www.springframework.net">
<description></description>
<object id="SearchResult" type="MyAccount.DTO.UserSearchResultDTO, MyAccount.DTO">
<constructor-arg index="0" value="V1" />
<constructor-arg index="1" value="V2" />
<constructor-arg index="2" value="1234XYZ" />
</object>
</objects>
</spring>
</configuration>
Can somebody tell me why the IApplicationContext ctx = ContextRegistry.GetContext() return null calling it in a class in the business object tier?
Thanks
Lado -- Another Newbie
I am a new member of the forum. Our team at the place of work is trying to use Spring.Net in our developement and I've been reading the docuemtataion and playing with examples/tutorials provided therein.
I have a very simple web app to which I added project for my business object. I want to use DoI in the business object (project) tier as a proof of concepts for my team but I run to problem.
I basically defined my objects in App.config file in the same name space as my business object tier is, as follows:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="spring">
<section name="context" type="Spring.Context.Support.ContextHandler, Spring.Core"/>
<section name="objects" type="Spring.Context.Support.DefaultSectionHandler, Spring.Core"/>
</sectionGroup>
</configSections>
<spring>
<context>
<resource uri="config://spring/objects"/>
</context>
<objects xmlns="http://www.springframework.net">
<description></description>
<object id="SearchResult" type="MyAccount.DTO.UserSearchResultDTO, MyAccount.DTO">
<constructor-arg index="0" value="V1" />
<constructor-arg index="1" value="V2" />
<constructor-arg index="2" value="1234XYZ" />
</object>
</objects>
</spring>
</configuration>
Can somebody tell me why the IApplicationContext ctx = ContextRegistry.GetContext() return null calling it in a class in the business object tier?
Thanks
Lado -- Another Newbie