Implementation of the HandlerAdapter
interface that maps handler methods based on HTTP paths, HTTP methods and
request parameters expressed through the RequestMapping annotation.

Supports request parameter binding through the RequestParam annotation.
Also supports the ModelAttribute annotation for exposing model attribute
values to the view, as well as InitBinder for binder initialization methods
and SessionAttributes for automatic session management of specific attributes.

This adapter can be customized through various bean properties.
A common use case is to apply shared binder initialization logic through
a custom WebBindingInitializer.

pageNotFoundLogger

AnnotationMethodHandlerAdapter

public AnnotationMethodHandlerAdapter()

Method Detail

setAlwaysUseFullPath

public void setAlwaysUseFullPath(boolean alwaysUseFullPath)

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).

setCacheSecondsForSessionAttributeHandlers

Cache content produced by @SessionAttributes annotated handlers
for the given number of seconds. Default is 0, preventing caching completely.

In contrast to the "cacheSeconds" property which will apply to all general
handlers (but not to @SessionAttributes annotated handlers), this
setting will apply to @SessionAttributes annotated handlers only.

setSynchronizeOnSession

public void setSynchronizeOnSession(boolean synchronizeOnSession)

Set if controller execution should be synchronized on the session,
to serialize parallel invocations from the same client.

More specifically, the execution of each handler method will get
synchronized if this flag is "true". The best available session mutex
will be used for the synchronization; ideally, this will be a mutex
exposed by HttpSessionMutexListener.

The session mutex is guaranteed to be the same object during
the entire lifetime of the session, available under the key defined
by the SESSION_MUTEX_ATTRIBUTE constant. It serves as a
safe reference to synchronize on for locking on the current session.

In many cases, the HttpSession reference itself is a safe mutex
as well, since it will always be the same object reference for the
same active logical session. However, this is not guaranteed across
different servlet containers; the only 100% safe way is a session mutex.

setCustomArgumentResolver

Set a custom ArgumentResolvers to use for special method parameter types.
Such a custom ArgumentResolver will kick in first, having a chance to
resolve an argument value before the standard argument handling kicks in.

setCustomArgumentResolvers

Set one or more custom ArgumentResolvers to use for special method
parameter types. Any such custom ArgumentResolver will kick in first,
having a chance to resolve an argument value before the standard
argument handling kicks in.

supports

Given a handler instance, return whether or not this HandlerAdapter can
support it. Typical HandlerAdapters will base the decision on the handler
type. HandlerAdapters will usually only support one handler type each.