HandlerMapping is responsible for translating a URL pattern to a controller. There are several URL mappers:
BeanNameUrlHandlerMapping: Maps a URL to a bean based on the name of the controller's bean, as defined in the bean's XML definition.SimpleUrlHandlerMapping: Maps a URL to a bean based on a list of properties. (In Listing 2, theSimpleUrlHandlerMappingclass is used to map/home.htmto the bean with the ID ofhomePageController.)ControllerClassNameHandlerMapping: Maps a URL to a bean based on the bean's class name. For example,HomePageControllerwould be mapped to/homePage*, such as/home.htm.ControllerBeanNameHandlerMapping: Similar to theBeanNameUrlHandlerMappingmapper, but does not expect bean names to follow the URL convention. Also supportsControllerannotations.CommonsPathMapHandlerMapping: Maps URLs to a controller based on Jakarta Commons Attributes metadata.DefaultAnnotationHandlerMapping: Maps URLs to a controller for methods that implement theRequestMappingannotation.
No comments:
Post a Comment