接口 MvcResult
public interface MvcResult
Provides access to the result of an executed request.- 从以下版本开始:
- 3.2
- 作者:
- Rossen Stoyanchev
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 Object
getAsyncResult()
Get the result of async execution.Object
getAsyncResult(long timeToWait)
Get the result of async execution.FlashMap
getFlashMap()
Return the "output" flash attributes saved during request processing.Object
getHandler()
Return the executed handler.HandlerInterceptor[]
getInterceptors()
Return interceptors around the handler.ModelAndView
getModelAndView()
Return theModelAndView
prepared by the handler.MockHttpServletRequest
getRequest()
Return the performed request.Exception
getResolvedException()
Return any exception raised by a handler and successfully resolved through aHandlerExceptionResolver
.MockHttpServletResponse
getResponse()
Return the resulting response.
方法详细资料
getRequest
MockHttpServletRequest getRequest()
Return the performed request.- 返回:
- the request, never
null
getResponse
MockHttpServletResponse getResponse()
Return the resulting response.- 返回:
- the response, never
null
getHandler
Object getHandler()
Return the executed handler.- 返回:
- the handler, possibly
null
if none were executed
getInterceptors
HandlerInterceptor[] getInterceptors()
Return interceptors around the handler.- 返回:
- interceptors, or
null
if none were selected
getModelAndView
ModelAndView getModelAndView()
Return theModelAndView
prepared by the handler.- 返回:
- a
ModelAndView
, ornull
getResolvedException
Exception getResolvedException()
Return any exception raised by a handler and successfully resolved through aHandlerExceptionResolver
.- 返回:
- an exception, possibly
null
getFlashMap
FlashMap getFlashMap()
Return the "output" flash attributes saved during request processing.- 返回:
- the
FlashMap
, possibly empty
getAsyncResult
Object getAsyncResult()
Get the result of async execution. This method will wait for the async result to be set for up to the amount of time configured on the async request, i.e.MockAsyncContext.getTimeout()
.- 抛出:
IllegalStateException
- if the async result was not set
getAsyncResult
Object getAsyncResult(long timeToWait)
Get the result of async execution. This method will wait for the async result to be set for up to the specified amount of time.- 参数:
timeToWait
- how long to wait for the async result to be set, in milliseconds; if -1, then the async request timeout value is used, i.e.MockAsyncContext.getTimeout()
.- 抛出:
IllegalStateException
- if the async result was not set