Can ' t get Webapplicationcontext object from Contextregistry.getcontext (): Resource handler for the ' web ' protocol are not D efined

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.