|
||||||||||
| 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.support.WebContentGenerator
org.parancoe.web.annotation.ParancoeAnnotationMethodHandlerAdapter
public class ParancoeAnnotationMethodHandlerAdapter
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.
setPathMatcher(org.springframework.util.PathMatcher),
setMethodNameResolver(org.springframework.web.servlet.mvc.multiaction.MethodNameResolver),
setWebBindingInitializer(org.springframework.web.bind.support.WebBindingInitializer),
setSessionAttributeStore(org.springframework.web.bind.support.SessionAttributeStore)| Field Summary | |
|---|---|
static java.lang.String |
PAGE_NOT_FOUND_LOG_CATEGORY
Log category to use when no mapped handler is found for a request. |
protected static org.apache.commons.logging.Log |
pageNotFoundLogger
Additional logger to use when no mapped handler is found for a request. |
| Fields inherited from class org.springframework.web.servlet.support.WebContentGenerator |
|---|
METHOD_GET, METHOD_HEAD, METHOD_POST |
| Fields inherited from class org.springframework.context.support.ApplicationObjectSupport |
|---|
logger |
| Constructor Summary | |
|---|---|
ParancoeAnnotationMethodHandlerAdapter()
|
|
| Method Summary | |
|---|---|
protected org.springframework.web.bind.ServletRequestDataBinder |
createBinder(javax.servlet.http.HttpServletRequest request,
java.lang.Object target,
java.lang.String objectName)
Template method for creating a new ServletRequestDataBinder instance. |
long |
getLastModified(javax.servlet.http.HttpServletRequest request,
java.lang.Object handler)
|
org.springframework.web.servlet.ModelAndView |
handle(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.Object handler)
|
protected org.springframework.web.servlet.ModelAndView |
handleNoSuchRequestHandlingMethod(org.springframework.web.servlet.mvc.multiaction.NoSuchRequestHandlingMethodException ex,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Handle the case where no request handler method was found. |
void |
setAlwaysUseFullPath(boolean alwaysUseFullPath)
Set if URL lookup should always use the full path within the current servlet context. |
void |
setCustomArgumentResolver(org.springframework.web.bind.support.WebArgumentResolver argumentResolver)
Set a custom ArgumentResolvers to use for special method parameter types. |
void |
setCustomArgumentResolvers(org.springframework.web.bind.support.WebArgumentResolver[] argumentResolvers)
Set one or more custom ArgumentResolvers to use for special method parameter types. |
void |
setMethodNameResolver(org.springframework.web.servlet.mvc.multiaction.MethodNameResolver methodNameResolver)
Set the MethodNameResolver to use for resolving default handler methods (carrying an empty @RequestMapping annotation). |
void |
setParameterNameDiscoverer(org.springframework.core.ParameterNameDiscoverer parameterNameDiscoverer)
Set the ParameterNameDiscoverer to use for resolving method parameter names if needed (e.g. for default attribute names). |
void |
setPathMatcher(org.springframework.util.PathMatcher pathMatcher)
Set the PathMatcher implementation to use for matching URL paths against registered URL patterns. |
void |
setSessionAttributeStore(org.springframework.web.bind.support.SessionAttributeStore sessionAttributeStore)
Specify the strategy to store session attributes with. |
void |
setSynchronizeOnSession(boolean synchronizeOnSession)
Set if controller execution should be synchronized on the session, to serialize parallel invocations from the same client. |
void |
setUrlDecode(boolean urlDecode)
Set if context path and request URI should be URL-decoded. |
void |
setUrlPathHelper(org.springframework.web.util.UrlPathHelper urlPathHelper)
Set the UrlPathHelper to use for resolution of lookup paths. |
void |
setValidator(org.springframework.validation.Validator validator)
Set the validator to use on @ModelAttribute parameter of methods annotated with @Validation. |
void |
setWebBindingInitializer(org.springframework.web.bind.support.WebBindingInitializer webBindingInitializer)
Specify a WebBindingInitializer which will apply pre-configured configuration to every DataBinder that this controller uses. |
boolean |
supports(java.lang.Object handler)
|
| Methods inherited from class org.springframework.web.servlet.support.WebContentGenerator |
|---|
applyCacheSeconds, applyCacheSeconds, cacheForSeconds, cacheForSeconds, checkAndPrepare, checkAndPrepare, getCacheSeconds, getSupportedMethods, isRequireSession, isUseCacheControlHeader, isUseCacheControlNoStore, isUseExpiresHeader, preventCaching, setCacheSeconds, setRequireSession, setSupportedMethods, setUseCacheControlHeader, setUseCacheControlNoStore, setUseExpiresHeader |
| Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport |
|---|
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext |
| 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 |
| Field Detail |
|---|
public static final java.lang.String PAGE_NOT_FOUND_LOG_CATEGORY
pageNotFoundLogger,
Constant Field Valuesprotected static final org.apache.commons.logging.Log pageNotFoundLogger
PAGE_NOT_FOUND_LOG_CATEGORY| Constructor Detail |
|---|
public ParancoeAnnotationMethodHandlerAdapter()
| Method Detail |
|---|
public void setAlwaysUseFullPath(boolean alwaysUseFullPath)
Default is "false".
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).
UrlPathHelper.setUrlDecode(boolean)public void setUrlPathHelper(org.springframework.web.util.UrlPathHelper urlPathHelper)
Use this to override the default UrlPathHelper with a custom subclass, or to share common UrlPathHelper settings across multiple HandlerMappings and HandlerAdapters.
public void setPathMatcher(org.springframework.util.PathMatcher pathMatcher)
AntPathMatcherpublic void setMethodNameResolver(org.springframework.web.servlet.mvc.multiaction.MethodNameResolver methodNameResolver)
@RequestMapping annotation).
Will only kick in when the handler method cannot be resolved uniquely through the annotation metadata already.
public void setWebBindingInitializer(org.springframework.web.bind.support.WebBindingInitializer webBindingInitializer)
public void setSessionAttributeStore(org.springframework.web.bind.support.SessionAttributeStore sessionAttributeStore)
Default is DefaultSessionAttributeStore,
storing session attributes in the HttpSession, using the same
attribute name as in the model.
public void setSynchronizeOnSession(boolean synchronizeOnSession)
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.
HttpSessionMutexListener,
WebUtils.getSessionMutex(javax.servlet.http.HttpSession)public void setParameterNameDiscoverer(org.springframework.core.ParameterNameDiscoverer parameterNameDiscoverer)
Default is a LocalVariableTableParameterNameDiscoverer.
public void setCustomArgumentResolver(org.springframework.web.bind.support.WebArgumentResolver argumentResolver)
public void setCustomArgumentResolvers(org.springframework.web.bind.support.WebArgumentResolver[] argumentResolvers)
public void setValidator(org.springframework.validation.Validator validator)
validator - public boolean supports(java.lang.Object handler)
supports in interface org.springframework.web.servlet.HandlerAdapter
public org.springframework.web.servlet.ModelAndView handle(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.Object handler)
throws java.lang.Exception
handle in interface org.springframework.web.servlet.HandlerAdapterjava.lang.Exception
public long getLastModified(javax.servlet.http.HttpServletRequest request,
java.lang.Object handler)
getLastModified in interface org.springframework.web.servlet.HandlerAdapter
protected org.springframework.web.servlet.ModelAndView handleNoSuchRequestHandlingMethod(org.springframework.web.servlet.mvc.multiaction.NoSuchRequestHandlingMethodException ex,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws java.lang.Exception
The default implementation logs a warning and sends an HTTP 404 error. Alternatively, a fallback view could be chosen, or the NoSuchRequestHandlingMethodException could be rethrown as-is.
ex - the NoSuchRequestHandlingMethodException to be handledrequest - current HTTP requestresponse - current HTTP response
null if handled directly
java.lang.Exception - an Exception that should be thrown as result of the servlet request
protected org.springframework.web.bind.ServletRequestDataBinder createBinder(javax.servlet.http.HttpServletRequest request,
java.lang.Object target,
java.lang.String objectName)
throws java.lang.Exception
The default implementation creates a standard ServletRequestDataBinder. This can be overridden for custom ServletRequestDataBinder subclasses.
request - current HTTP requesttarget - the target object to bind onto (or null
if the binder is just used to convert a plain parameter value)objectName - the objectName of the target object
java.lang.Exception - in case of invalid state or argumentsServletRequestDataBinder.bind(javax.servlet.ServletRequest),
DataBinder.convertIfNecessary(Object, Class, MethodParameter)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||