|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.context.support.ApplicationObjectSupport
org.springframework.web.context.support.WebApplicationObjectSupport
org.springframework.web.servlet.handler.AbstractHandlerMapping
org.springframework.web.servlet.handler.AbstractUrlHandlerMapping
Abstract base class for URL-mapped HandlerMapping implementations. Provides infrastructure for mapping handlers to URLs and configurable URL lookup. For information on the latter, see alwaysUseFullPath property.
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 PathMatcher class.
setAlwaysUseFullPath(boolean)
,
setUrlDecode(boolean)
,
PathMatcher
Field Summary |
Fields inherited from class org.springframework.web.servlet.handler.AbstractHandlerMapping |
logger |
Constructor Summary | |
AbstractUrlHandlerMapping()
|
Method Summary | |
protected java.lang.Object |
getHandlerInternal(javax.servlet.http.HttpServletRequest request)
Look up a handler for the URL path of the given request. |
protected java.lang.Object |
lookupHandler(java.lang.String urlPath)
Look up a handler instance for the given URL path. |
protected void |
registerHandler(java.lang.String urlPath,
java.lang.Object handler)
Register the given handler instance for the given URL path. |
void |
setAlwaysUseFullPath(boolean alwaysUseFullPath)
Set if URL lookup should always use full path within current servlet context. |
void |
setLazyInitHandlers(boolean lazyInitHandlers)
Set whether to lazily initialize handlers. |
void |
setUrlDecode(boolean urlDecode)
Set if context path and request URI should be URL-decoded. |
void |
setUrlPathHelper(UrlPathHelper urlPathHelper)
Set the UrlPathHelper to use for resolution of lookup paths. |
Methods inherited from class org.springframework.web.servlet.handler.AbstractHandlerMapping |
getDefaultHandler, getHandler, getOrder, setDefaultHandler, setInterceptors, setOrder |
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport |
getServletContext, getTempDir, getWebApplicationContext, requiredContextClass |
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport |
getApplicationContext, getMessageSourceAccessor, initApplicationContext, setApplicationContext |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public AbstractUrlHandlerMapping()
Method Detail |
public void setAlwaysUseFullPath(boolean alwaysUseFullPath)
UrlPathHelper.setAlwaysUseFullPath(boolean)
public void setUrlDecode(boolean urlDecode)
Uses either the request encoding or the default encoding according to the Servlet spec (ISO-8859-1).
Note: Setting this to true requires J2SE 1.4, as J2SE 1.3's URLDecoder class does not offer a way to specify the encoding.
UrlPathHelper.setUrlDecode(boolean)
public void setUrlPathHelper(UrlPathHelper urlPathHelper)
Use this to override the default UrlPathHelper with a custom subclass, or to share common UrlPathHelper settings across multiple HandlerMappings and MethodNameResolvers.
AbstractUrlMethodNameResolver.setUrlPathHelper(org.springframework.web.util.UrlPathHelper)
public void setLazyInitHandlers(boolean lazyInitHandlers)
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.
protected java.lang.Object getHandlerInternal(javax.servlet.http.HttpServletRequest request) throws BeansException
getHandlerInternal
in class AbstractHandlerMapping
request
- current HTTP request
BeansException
protected java.lang.Object lookupHandler(java.lang.String urlPath) throws BeansException
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 PathMatcher class.
urlPath
- URL the bean is mapped to
BeansException
PathMatcher
protected void registerHandler(java.lang.String urlPath, java.lang.Object handler) throws BeansException
urlPath
- URL the bean is mapped tohandler
- the handler instance
BeansException
- if the handler couldn't be registered
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |