C# 클래스 Spring.Web.Support.MappingHandlerFactory

MappingHandleryFactory allows for full Spring-managed <httpHandlers> configuration. It uses regular expressions for url matching.
The example below shows, how to map all url requests to spring and let MappingHandlerFactory resolve urls to container-managed IHttpHandlerFactory or IHttpHandler objects. // web.config <httpHandlers> <!-- map all requests to spring (just for demo - don't do this at home!) --> <add verb="*" path="*.*" type="Spring.Web.Support.MappingHandlerFactory, Spring.Web" /> </httpHandlers> // spring-objects.config <object type="Spring.Web.Support.MappingHandlerFactoryConfigurer, Spring.Web"> <property name="HandlerMap"> <dictionary> <entry key="\.ashx$" value="standardHandlerFactory" /> <!-- map any request ending with *.whatever to standardHandlerFactory --> <entry key="\.whatever$" value="specialHandlerFactory" /> </dictionary> </property> </object> <object name="standardHandlerFactory" type="Spring.Web.Support.DefaultHandlerFactory, Spring.Web" /> <object name="specialHandlerFactory" type="MySpecialHandlerFactoryImpl" />
상속: Spring.Web.Support.AbstractHandlerFactory
파일 보기 프로젝트 열기: spring-projects/spring-net

공개 메소드들

메소드 설명
ReleaseHandler ( IHttpHandler handler ) : void

Enables a factory to release an existing System.Web.IHttpHandler instance.

보호된 메소드들

메소드 설명
CreateHandlerInstance ( IConfigurableApplicationContext appContext, HttpContext context, string requestType, string rawUrl, string physicalPath ) : IHttpHandler

Create a handler instance for the given URL. Will try to find a match of rawUrl onto patterns in HandlerMap. If a match is found, delegates the call to the matching IHttpHandlerFactory.GetHandler method.

MapHandlerInstance ( IConfigurableApplicationContext appContext, HttpContext context, string requestType, string rawUrl, string physicalPath, HandlerMap handlerMappings, IDictionary handlerWithFactoryTable ) : IHttpHandler

Obtains a handler by mapping rawUrl to the list of patterns in handlerMappings.

ReleaseHandler ( IHttpHandler handler, IDictionary _handlerWithFactoryTable ) : void

Removes the handler from the handler/factory dictionary and releases the handler.

메소드 상세

CreateHandlerInstance() 보호된 메소드

Create a handler instance for the given URL. Will try to find a match of rawUrl onto patterns in HandlerMap. If a match is found, delegates the call to the matching IHttpHandlerFactory.GetHandler method.
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.
리턴 IHttpHandler

MapHandlerInstance() 보호된 메소드

Obtains a handler by mapping rawUrl to the list of patterns in handlerMappings.
protected MapHandlerInstance ( IConfigurableApplicationContext appContext, HttpContext context, string requestType, string rawUrl, string physicalPath, HandlerMap handlerMappings, IDictionary handlerWithFactoryTable ) : IHttpHandler
appContext IConfigurableApplicationContext the application context corresponding to the current request
context 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.
handlerMappings HandlerMap
handlerWithFactoryTable IDictionary
리턴 IHttpHandler

ReleaseHandler() 공개 메소드

Enables a factory to release an existing System.Web.IHttpHandler instance.
public ReleaseHandler ( IHttpHandler handler ) : void
handler IHttpHandler /// The object to release. ///
리턴 void

ReleaseHandler() 보호된 메소드

Removes the handler from the handler/factory dictionary and releases the handler.
protected ReleaseHandler ( IHttpHandler handler, IDictionary _handlerWithFactoryTable ) : void
handler IHttpHandler the handler to be released
_handlerWithFactoryTable IDictionary a dictionary containing (, ) entries.
리턴 void