Top Description Constructors Methods
org.springframework.web.servlet.handler

public Class BeanNameUrlHandlerMapping

extends AbstractDetectingUrlHandlerMapping
Class Inheritance
Imports
java.util.ArrayList, .List, org.springframework.util.StringUtils

Implementation of the org.springframework.web.servlet.HandlerMapping interface that maps from URLs to beans with names that start with a slash ("/"), similar to how Struts maps URLs to action names.

This is the default implementation used by the org.springframework.web.servlet.DispatcherServlet, along with org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping. Alternatively, SimpleUrlHandlerMapping allows for customizing a handler mapping declaratively.

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.

Supports direct matches (given "/test" -> registered "/test") and "*" matches (given "/test" -> registered "/t*"). For details on the pattern options, see the org.springframework.web.util.pattern.PathPattern javadoc.

Authors
Rod Johnson, Juergen Hoeller
See Also
SimpleUrlHandlerMapping

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected String[]
determineUrlsForHandler(String
the name of the candidate bean
beanName
)

Implements abstract org.springframework.web.servlet.handler.AbstractDetectingUrlHandlerMapping.determineUrlsForHandler.

Checks name and aliases of the given bean for URLs, starting with "/".

Inherited from org.springframework.web.servlet.handler.AbstractDetectingUrlHandlerMapping:
detectHandlersinitApplicationContextsetDetectHandlersInAncestorContexts

Constructor Detail

BeanNameUrlHandlerMappingback to summary
public BeanNameUrlHandlerMapping()

Method Detail

determineUrlsForHandlerback to summary
protected String[] determineUrlsForHandler(String beanName)

Implements abstract org.springframework.web.servlet.handler.AbstractDetectingUrlHandlerMapping.determineUrlsForHandler.

Checks name and aliases of the given bean for URLs, starting with "/".

Parameters
beanName:String

Doc from org.springframework.web.servlet.handler.AbstractDetectingUrlHandlerMapping.determineUrlsForHandler.

the name of the candidate bean

Returns:String[]

Doc from org.springframework.web.servlet.handler.AbstractDetectingUrlHandlerMapping.determineUrlsForHandler.

the URLs determined for the bean, or an empty array if none

Annotations
@Override