Set the default AsyncTaskExecutor to use when a controller method
return a Callable. Controller methods can override this default on
a per-request basis by returning an WebAsyncTask.
By default a SimpleAsyncTaskExecutor instance is used.
It's recommended to change that default in production as the simple executor
does not re-use threads.
public void setAsyncRequestTimeout(long timeout)
Specify the amount of time, in milliseconds, before concurrent handling
should time out. In Servlet 3, the timeout begins after the main request
processing thread has exited and ends when the request is dispatched again
for further processing of the concurrently produced result.
If this value is not set, the default timeout of the underlying
implementation is used, e.g. 10 seconds on Tomcat with Servlet 3.
Return the configured reactive type registry of adapters.
public void setIgnoreDefaultModelOnRedirect(boolean ignoreDefaultModelOnRedirect)
By default the content of the "default" model is used both during
rendering and redirect scenarios. Alternatively a controller method
can declare a RedirectAttributes argument and use it to provide
attributes for a redirect.
Setting this flag to true guarantees the "default" model is
never used in a redirect scenario even if a RedirectAttributes argument
is not declared. Setting it to false means the "default" model
may be used in a redirect if the controller method doesn't declare a
The default setting is false but new applications should
consider setting it to true.
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 the handleRequestInternal
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.
Always return true since any method argument and return value
type will be processed in some way. A method argument not recognized
by any HandlerMethodArgumentResolver is interpreted as a request parameter
if it is a simple type, or as a model attribute otherwise. A return value
not recognized by any HandlerMethodReturnValueHandler will be interpreted
as a model attribute.