httpmodule

xiaoxiao2021-03-06  22

Implementing URL rewriting in ASP.NET is simple, just call the RewritePath () method of the System.Web.httpContext class. The HTTPContext class contains HTTP specification information about a particular HTTP request. Each of the ASP.NET engines created a specific instance for each request, this class contains some properties such as: request and response properties, providing access to requests and responses, providing access to request and response; Application and session attributes provide Application variables Access to session variables; User properties provide access to authorized user information. Recall the BeginRequest event triggered before the AuthenticateRequest event, and the AuthenticateRequest event is triggered before the AuthorizeRequest event. So when is the HTTPModule call URL to rewrite the right? He decided to verify the verification method used. To rewrite the URL in the AuthorizeRequest event commission, calling or putting this feature in the BeginRequest event or the AuthenticateRequest event call if you use a Windows authentication method.

* HTTPContext is equivalent to Java's servletContext, refers to the environment that is packaged for the current request (Request)

Squiring ASP.NET Framework processes a process of HTTP Request:

HttpRequest -> inetinfo.exe -> ASPNET_IPI.DLL -> http pipeline -> ASPNET_WP.EXE -> httpauntime -> httpApplication factory -> httpApplication -> httpmodule -> httphandler factory -> httphandler -> httphandler.processRequest ()

转载请注明原文地址:https://www.9cbs.com/read-43125.html

New Post(0)