com.interface21.web.servlet.handler
Class BeanNameUrlHandlerMapping

java.lang.Object
  |
  +--com.interface21.context.support.ApplicationObjectSupport
        |
        +--com.interface21.web.servlet.handler.AbstractHandlerMapping
              |
              +--com.interface21.web.servlet.handler.AbstractUrlHandlerMapping
                    |
                    +--com.interface21.web.servlet.handler.BeanNameUrlHandlerMapping
All Implemented Interfaces:
ApplicationContextAware, HandlerMapping, Ordered

public class BeanNameUrlHandlerMapping
extends AbstractUrlHandlerMapping

Implementation of the HandlerMapping interface to map from URLs to beans. This is the default implementation used by the DispatcherServlet, but is somewhat naive. A SimpleUrlHandlerMapping or a custom handler mapping should be used by preference.

The mapping is from URL to bean name. Thus an incoming URL "/foo" would map to a handler named "/foo", or to "/foo /foo2" in case of multiple mappings to a single handler. Note: In XML definitions, you'll need to use an alias "name=/foo" in the bean definition, as the XML id may not contain slashes.

Supports direct matches (given "/test" -> registered "/test") and "*" matches (given "/test" -> registered "/t*").

Author:
Rod Johnson, Juergen Hoeller
See Also:
SimpleUrlHandlerMapping

Field Summary
static java.lang.String MULTI_URL_DELIMITER
          Delimiter between multiple URLs in mappings
 
Fields inherited from class com.interface21.web.servlet.handler.AbstractHandlerMapping
logger
 
Constructor Summary
BeanNameUrlHandlerMapping()
           
 
Method Summary
 void initApplicationContext()
          Subclasses can override this for custom initialization behavior.
 
Methods inherited from class com.interface21.web.servlet.handler.AbstractUrlHandlerMapping
getHandlerInternal, initHandler, lookupHandler, registerHandler, setAlwaysUseFullPath
 
Methods inherited from class com.interface21.web.servlet.handler.AbstractHandlerMapping
getDefaultHandler, getHandler, getOrder, setDefaultHandler, setInterceptors, setOrder
 
Methods inherited from class com.interface21.context.support.ApplicationObjectSupport
getApplicationContext, setApplicationContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.interface21.context.ApplicationContextAware
setApplicationContext
 

Field Detail

MULTI_URL_DELIMITER

public static final java.lang.String MULTI_URL_DELIMITER
Delimiter between multiple URLs in mappings
Constructor Detail

BeanNameUrlHandlerMapping

public BeanNameUrlHandlerMapping()
Method Detail

initApplicationContext

public void initApplicationContext()
Description copied from class: ApplicationObjectSupport
Subclasses can override this for custom initialization behavior. Gets called by setApplicationContext() after setting the context instance.
Overrides:
initApplicationContext in class ApplicationObjectSupport


Rod Johnson and Spring contributors 2001-2003.