Spring.NET 1.3.0 RC1 for .NET 2.0 API Reference

MappingHandlerFactory Class

MappingHandleryFactory allows for full Spring-managed <httpHandlers> configuration. It uses regular expressions for url matching.

For a list of all members of this type, see MappingHandlerFactory Members .

System.Object
   AbstractHandlerFactory
      MappingHandlerFactory

[Visual Basic]
Public Class MappingHandlerFactory
    Inherits AbstractHandlerFactory
[C#]
public class MappingHandlerFactory : AbstractHandlerFactory

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Remarks

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" />

Requirements

Namespace: Spring.Web.Support

Assembly: Spring.Web (in Spring.Web.dll)

See Also

MappingHandlerFactory Members | Spring.Web.Support Namespace | IHttpHandlerFactory | IHttpHandler | HandlerMap | MappingHandlerFactoryConfigurer