Sprint. Net notes, sprint.net notes
I did not write the first blog I wrote in my life. Please instruct experts.
1. Introduce Spring. Core. dll and Common. Logging. dll.
2. Add the sprint node to <ConfigSections> of Web. conf In the UI Layer.
<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>
3. Add it under <configuration>.
<configuration> ... ... ... <spring> <context> <resource uri="config://spring/objects" /> </context> <objects xmlns="http://www.springframework.net"> <object id="UserInfoService" type="Icdce.UserLimit.BLL.UserInfoService,Icdce.UserLimit.BLL" singleton="false"></object> </objects> </spring></configuration>
4. Then the frontend can call the intermediate method.
IApplicationContext ctx = ContextRegistry.GetContext();IBLL.IUserInfoService userInfo = ctx.GetObject("UserInfoService") as IBLL.IUserInfoService;