接口 MvcResult

所有已知实现类:
DefaultMvcResult, MockMvcHttpConnector.PrintingMvcResult

public interface MvcResult
Provides access to the result of an executed request.
从以下版本开始:
4.0
作者:
Rossen Stoyanchev, Harry Yang
  • 字段详细资料

    • VIEW_ATTRIBUTE

      static final String VIEW_ATTRIBUTE
    • VIEW_NAME_ATTRIBUTE

      static final String VIEW_NAME_ATTRIBUTE
    • MODEL_AND_VIEW_ATTRIBUTE

      static final String MODEL_AND_VIEW_ATTRIBUTE
  • 方法详细资料

    • getRequest

      Return the performed request.
      返回:
      the request, never null
    • getResponse

      Return the resulting response.
      返回:
      the response, never null
    • getRequestContext

      cn.taketoday.web.RequestContext getRequestContext()
    • getHandler

      @Nullable Object getHandler()
      Return the executed handler.
      返回:
      the handler, possibly null if none were executed
    • getInterceptors

      @Nullable cn.taketoday.web.HandlerInterceptor[] getInterceptors()
      Return interceptors around the handler.
      返回:
      interceptors, or null if none were selected
    • getModelAndView

      @Nullable cn.taketoday.web.view.ModelAndView getModelAndView()
      Return the ModelAndView prepared by the handler.
      返回:
      a ModelAndView, or null if none
    • getResolvedException

      @Nullable Throwable getResolvedException()
      Return any exception raised by a handler and successfully resolved through a HandlerExceptionHandler.
      返回:
      an exception, or null if none
    • getFlashMap

      cn.taketoday.web.view.RedirectModel getFlashMap()
      Return the "output" flash attributes saved during request processing.
      返回:
      the RedirectModel, possibly empty
    • getAsyncResult

      Object getAsyncResult()
      Get the result of async execution.

      This method will wait for the async result to be set within the timeout value associated with the async request, see MockAsyncContext#setTimeout. Alternatively, use getAsyncResult(long) to specify the amount of time to wait.

      抛出:
      IllegalStateException - if the async result was not set
    • getAsyncResult

      Object getAsyncResult(long timeToWait)
      Get the result of async execution and wait if necessary.
      参数:
      timeToWait - how long to wait for the async result to be set, in milliseconds; if -1, then fall back on the timeout value associated with the async request, see MockAsyncContext#setTimeout for more details.
      抛出:
      IllegalStateException - if the async result was not set