| org.springframework.web.servlet.handler.AbstractHandlerMapping org.springframework.web.servlet.handler.AbstractUrlHandlerMapping
All known Subclasses: org.springframework.web.servlet.mvc.support.ControllerClassNameHandlerMapping, org.springframework.web.servlet.handler.metadata.AbstractPathMapHandlerMapping, org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping, org.springframework.web.servlet.handler.SimpleUrlHandlerMapping,
Method Summary | |
protected void | exposePathWithinMapping(String pathWithinMapping, HttpServletRequest request) Expose the path within the current mapping as request attribute. | protected Object | getHandlerInternal(HttpServletRequest request) Look up a handler for the URL path of the given request. | final public Map | getHandlerMap() Return the registered handlers as an unmodifiable Map, with the registered path
as key and the handler object (or handler bean name in case of a lazy-init handler)
as value. | public Object | getRootHandler() Return the root handler for this handler mapping (registered for "/"),
or null if none. | protected Object | lookupHandler(String urlPath, HttpServletRequest request) Look up a handler instance for the given URL path.
Supports direct matches, e.g. | protected void | registerHandler(String[] urlPaths, String beanName) Register the specified handler for the given URL paths. | protected void | registerHandler(String urlPath, Object handler) Register the specified handler for the given URL path. | public void | setAlwaysUseFullPath(boolean alwaysUseFullPath) Set if URL lookup should always use the full path within the current servlet
context. | public void | setLazyInitHandlers(boolean lazyInitHandlers) Set whether to lazily initialize handlers. | public void | setPathMatcher(PathMatcher pathMatcher) Set the PathMatcher implementation to use for matching URL paths
against registered URL patterns. | public void | setRootHandler(Object rootHandler) Set the root handler for this handler mapping, that is,
the handler to be registered for the root path ("/"). | public void | setUrlDecode(boolean urlDecode) Set if context path and request URI should be URL-decoded. | public void | setUrlPathHelper(UrlPathHelper urlPathHelper) Set the UrlPathHelper to use for resolution of lookup paths. |
getHandlerInternal | protected Object getHandlerInternal(HttpServletRequest request) throws Exception(Code) | | Look up a handler for the URL path of the given request.
Parameters: request - current HTTP request the handler instance, or null if none found |
getHandlerMap | final public Map getHandlerMap()(Code) | | Return the registered handlers as an unmodifiable Map, with the registered path
as key and the handler object (or handler bean name in case of a lazy-init handler)
as value.
See Also: AbstractUrlHandlerMapping.getDefaultHandler() |
getRootHandler | public Object getRootHandler()(Code) | | Return the root handler for this handler mapping (registered for "/"),
or null if none.
|
lookupHandler | protected Object lookupHandler(String urlPath, HttpServletRequest request)(Code) | | Look up a handler instance for the given URL path.
Supports direct matches, e.g. a registered "/test" matches "/test",
and various Ant-style pattern matches, e.g. a registered "/t*" matches
both "/test" and "/team". For details, see the AntPathMatcher class.
Looks for the most exact pattern, where most exact is defined as
the longest path pattern.
Parameters: urlPath - URL the bean is mapped to Parameters: request - current HTTP request (to expose the path within the mapping to) the associated handler instance, or null if not found See Also: AbstractUrlHandlerMapping.exposePathWithinMapping See Also: org.springframework.util.AntPathMatcher |
registerHandler | protected void registerHandler(String[] urlPaths, String beanName) throws BeansException, IllegalStateException(Code) | | Register the specified handler for the given URL paths.
Parameters: urlPaths - the URLs that the bean should be mapped to Parameters: beanName - the name of the handler bean throws: BeansException - if the handler couldn't be registered throws: IllegalStateException - if there is a conflicting handler registered |
registerHandler | protected void registerHandler(String urlPath, Object handler) throws BeansException, IllegalStateException(Code) | | Register the specified handler for the given URL path.
Parameters: urlPath - the URL the bean should be mapped to Parameters: handler - the handler instance or handler bean name String(a bean name will automatically be resolved into the corrresponding handler bean) throws: BeansException - if the handler couldn't be registered throws: IllegalStateException - if there is a conflicting handler registered |
setAlwaysUseFullPath | public void setAlwaysUseFullPath(boolean alwaysUseFullPath)(Code) | | Set if URL lookup should always use the full path within the current servlet
context. Else, the path within the current servlet mapping is used if applicable
(that is, in the case of a ".../*" servlet mapping in web.xml).
Default is "false".
See Also: org.springframework.web.util.UrlPathHelper.setAlwaysUseFullPath |
setLazyInitHandlers | public void setLazyInitHandlers(boolean lazyInitHandlers)(Code) | | Set whether to lazily initialize handlers. Only applicable to
singleton handlers, as prototypes are always lazily initialized.
Default is "false", as eager initialization allows for more efficiency
through referencing the controller objects directly.
If you want to allow your controllers to be lazily initialized,
make them "lazy-init" and set this flag to true. Just making them
"lazy-init" will not work, as they are initialized through the
references from the handler mapping in this case.
|
setRootHandler | public void setRootHandler(Object rootHandler)(Code) | | Set the root handler for this handler mapping, that is,
the handler to be registered for the root path ("/").
Default is null , indicating no root handler.
|
setUrlDecode | public void setUrlDecode(boolean urlDecode)(Code) | | Set if context path and request URI should be URL-decoded. Both are returned
undecoded by the Servlet API, in contrast to the servlet path.
Uses either the request encoding or the default encoding according
to the Servlet spec (ISO-8859-1).
Note: Setting this to "true" requires JDK 1.4 if the encoding differs
from the VM's platform default encoding, as JDK 1.3's URLDecoder class
does not offer a way to specify the encoding.
See Also: org.springframework.web.util.UrlPathHelper.setUrlDecode |
|
|