System.Web.HttpApplication.MapHttpHandler中定义了
IHttpHandlerFactory2 httpHandlerFactory = factory as IHttpHandlerFactory2; if (httpHandlerFactory != null) { httpHandler = httpHandlerFactory.GetHandler(context, requestType, path, pathTranslated); } else { httpHandler = factory.GetHandler(context, requestType, path.VirtualPathString, pathTranslated); }
这个是handler factory不为null的情况下,但是如果factory为null 那在哪里取到httpHandler?
比如我配置了
<add verb="*" path="*.abc" type="WebApplication1.App_Code.CustomHttpHandler, WebApplication1"/>
对 test.abc的访问交给CustomHttpHandler,这个寻找handler的过程在哪个位置?