|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.context.support.ApplicationObjectSupport org.springframework.web.context.support.WebApplicationObjectSupport org.springframework.web.servlet.handler.AbstractHandlerMapping
public abstract class AbstractHandlerMapping
Abstract base class for HandlerMapping
implementations.
Supports ordering, a default handler, and handler interceptors.
getHandlerInternal(javax.servlet.http.HttpServletRequest)
,
setDefaultHandler(java.lang.Object)
,
setInterceptors(org.springframework.web.servlet.HandlerInterceptor[])
,
HandlerInterceptor
Field Summary |
---|
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport |
---|
logger |
Constructor Summary | |
---|---|
AbstractHandlerMapping()
|
Method Summary | |
---|---|
Object |
getDefaultHandler()
Return the default handler for this handler mapping. |
HandlerExecutionChain |
getHandler(HttpServletRequest request)
Look up a handler for the given request, falling back to the default handler if no specific one is found. |
protected abstract Object |
getHandlerInternal(HttpServletRequest request)
Look up a handler for the given request, returning null if no
specific one is found. |
int |
getOrder()
Return the order value of this object, higher value meaning greater in terms of sorting. |
void |
setDefaultHandler(Object defaultHandler)
Set the default handler for this handler mapping. |
void |
setInterceptors(HandlerInterceptor[] interceptors)
Set the handler interceptors to apply for all handlers mapped by this handler mapping. |
void |
setOrder(int order)
|
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport |
---|
getServletContext, getTempDir, getWebApplicationContext, isContextRequired |
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport |
---|
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractHandlerMapping()
Method Detail |
---|
public final void setOrder(int order)
public final int getOrder()
Ordered
Higher value can be interpreted as lower priority, consequently the first object has highest priority (somewhat analogous to Servlet "load-on-startup" values).
public final void setDefaultHandler(Object defaultHandler)
Default is null
, indicating no default handler.
defaultHandler
- default handler instance, or null
if nonepublic final Object getDefaultHandler()
null
if nonepublic final void setInterceptors(HandlerInterceptor[] interceptors)
interceptors
- array of handler interceptors, or null
if nonepublic final HandlerExecutionChain getHandler(HttpServletRequest request) throws Exception
getHandler
in interface HandlerMapping
request
- current HTTP request
Exception
- if there is an internal errorgetHandlerInternal(javax.servlet.http.HttpServletRequest)
protected abstract Object getHandlerInternal(HttpServletRequest request) throws Exception
null
if no
specific one is found. This method is called by getHandler;
a null
return value will lead to the default handler, if one is set.
- Parameters:
request
- current HTTP request
- Returns:
- the corresponding handler instance, or
null
if none found
- Throws:
Exception
- if there is an internal error
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |