I ' m stucked in configuring my Web. config file under a Web Forms project in order to get a instance of Webapplicationconte XT (at Global.asax) and then being able to use scope= "application | Session | Request
<sectiongroup name="Spring"> <section name="Context" type="Spring.Context.Support.WebContextHandler, Spring.web"/> <section name="Objects" type="Spring.Context.Support.DefaultSectionHandler, Spring.core" /> </sectionGroup> <spring> <context type="Spring.Context.Support.WebApplicationContext, Spring.web"> <resource URI="~/configuration/spring.xml" /> </context> </spring> <add verb="*" Path="*.aspx" type="Spring.Web.Support.PageHandlerFactory, Spring.web"/> <add name="Spring" type="Spring.Context.Support.WebSupportModule, Spring.web"/>
I-then trying-to-add the Webapplicationcontext to my Application object, and in order to cosume on any. aspx page;
protected void Application_Start(ObjectSender, EventArgse) { //exception happens on next line! Application.ADD("Containerid", Contextregistry.GetContext()); }
Exception I ' m getting is;
"Error Creating context ' spring.root ': Resource handler for the ' web ' protocol are not defined. Spring.net "
Add this to system.webserver config node:
<Modules Runallmanagedmodulesforallrequests="true"> <Add Name="Spring"Precondition="Integratedmode"type="Spring.Context.Support.WebSupportModule, Spring.web"/></Modules>
If you use Integratedmode in IIS7
Pasting
Can ' t get Webapplicationcontext object from Contextregistry.getcontext (): Resource handler for the ' web ' protocol are not D efined