C# Class Spring.Web.Support.PageHandlerFactory

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
Mostra file Open project: spring-projects/spring-net Class Usage Examples

Public Methods

Method Description
GetHandler ( HttpContext context, string requestType, string url, string physicalPath ) : IHttpHandler

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.

Protected Methods

Method Description
CreateHandlerInstance ( IConfigurableApplicationContext appContext, HttpContext context, string requestType, string rawUrl, string physicalPath ) : IHttpHandler

Create a handler instance for the given URL.

Method Details

CreateHandlerInstance() protected method

Create a handler instance for the given URL.
protected CreateHandlerInstance ( IConfigurableApplicationContext appContext, HttpContext context, string requestType, string rawUrl, string physicalPath ) : IHttpHandler
appContext IConfigurableApplicationContext the application context corresponding to the current request
context System.Web.HttpContext The instance for this request.
requestType string The HTTP data transfer method (GET, POST, ...)
rawUrl string The requested .
physicalPath string The physical path of the requested resource.
return IHttpHandler

GetHandler() public method

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
return IHttpHandler