Implementation of System.Web.IHttpHandlerFactory that retrieves configured IHttpHandler instances from Spring web application context.

This handler factory uses the page name from the URL, without the extension, to find the handler object in the Spring context. This means that the target object definition doesn't need to resolve to an .aspx page -- it can be any valid object that implements IHttpHandler interface.

If the specified page is not found in the Spring application context, this handler factory falls back to the standard ASP.NET behavior and tries to find physical page with a given name.

In either case, handlers that implement IApplicationContextAware and ISharedStateAware will be provided with the references to appropriate Spring.NET application context (based on the request URL) and a IDictionary that should be used to store the information that needs to be shared by all instances of the handler.

Inheritance: Spring.Web.Support.AbstractHandlerFactory
 public static void PageHandlerFactoryBehavesLikeSystemPageHandlerFactoryImpl()
 {
     using (TestWebContext ctx = new TestWebContext("/Test", "DoesNotExist.aspx"))
     {
         try
         {
             IHttpHandlerFactory phf = new PageHandlerFactory();
             phf.GetHandler(HttpContext.Current, "GET", ctx.HttpWorkerRequest.GetFilePath(), ctx.HttpWorkerRequest.GetFilePathTranslated());
         }
         catch (HttpException e)
         {
             Assert.AreEqual(404, e.GetHttpCode());
             Assert.IsTrue(e.Message.IndexOf(ctx.HttpWorkerRequest.GetFilePath()) > 0);
         }
     }
 }
 public static void PageHandlerFactoryBehavesLikeSystemPageHandlerFactoryImpl()
 {
     using (TestWebContext ctx = new TestWebContext("/Test", "DoesNotExist.aspx"))
     {
         try
         {
             IHttpHandlerFactory phf = new PageHandlerFactory();
             phf.GetHandler(HttpContext.Current, "GET", ctx.HttpWorkerRequest.GetFilePath(), ctx.HttpWorkerRequest.GetFilePathTranslated());
         }
         catch (HttpException e)
         {
             Assert.AreEqual(404, e.GetHttpCode());
             Assert.IsTrue(e.Message.IndexOf(ctx.HttpWorkerRequest.GetFilePath()) > 0);
         }
     }
 }