Class SimpleUrlHandlerMapping
java.lang.Object
org.springframework.context.support.ApplicationObjectSupport
org.springframework.web.context.support.WebApplicationObjectSupport
org.springframework.web.servlet.handler.AbstractHandlerMapping
org.springframework.web.servlet.handler.AbstractUrlHandlerMapping
org.springframework.web.servlet.handler.SimpleUrlHandlerMapping
- All Implemented Interfaces:
Aware, BeanNameAware, ApplicationContextAware, Ordered, ServletContextAware, MatchableHandlerMapping, HandlerMapping
- Direct Known Subclasses:
WebSocketHandlerMapping
Implementation of the
HandlerMapping
interface that maps from URLs to request handler beans. Supports both mapping to bean
instances and mapping to bean names; the latter is required for non-singleton handlers.
The "urlMap" property is suitable for populating the handler map with bean references, for example, via the map element in XML bean definitions.
Mappings to bean names can be set via the "mappings" property, in a form
accepted by the java.util.Properties class, as follows:
/welcome.html=ticketController /show.html=ticketController
The syntax is PATH=HANDLER_BEAN_NAME. If the path doesn't begin
with a slash, one is prepended.
Supports direct matches (given "/test" -> registered "/test") and "*"
matches (given "/test" -> registered "/t*"). For details on the pattern
options, see the PathPattern
javadoc.
- Author:
- Rod Johnson, Juergen Hoeller, Sam Brannen
- See Also:
-
Field Summary
Fields inherited from class AbstractHandlerMapping
mappingsLoggerFields inherited from class ApplicationObjectSupport
loggerFields inherited from interface HandlerMapping
API_VERSION_ATTRIBUTE, BEST_MATCHING_HANDLER_ATTRIBUTE, BEST_MATCHING_PATTERN_ATTRIBUTE, INTROSPECT_TYPE_LEVEL_MAPPING, LOOKUP_PATH, MATRIX_VARIABLES_ATTRIBUTE, PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE, PRODUCIBLE_MEDIA_TYPES_ATTRIBUTE, URI_TEMPLATE_VARIABLES_ATTRIBUTEFields inherited from interface Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
ConstructorsConstructorDescriptionCreate aSimpleUrlHandlerMappingwith default settings.SimpleUrlHandlerMapping(Map<String, ?> urlMap) Create aSimpleUrlHandlerMappingusing the supplied URL map.