GetHandler() 공개 메소드

Retrieves instance of the configured page from Spring web application context, or if page is not defined in Spring config file tries to find it using standard ASP.Net mechanism.
public GetHandler ( HttpContext context, string requestType, string url, string physicalPath ) : IHttpHandler
context System.Web.HttpContext Current HttpContext
requestType string Type of HTTP request (GET, POST, etc.)
url string Requested page URL
physicalPath string Translated server path for the page
리턴 IHttpHandler
 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);
         }
     }
 }