类 ParameterizableViewController
java.lang.Object
cn.taketoday.context.support.ApplicationObjectSupport
cn.taketoday.web.WebContentGenerator
cn.taketoday.web.handler.mvc.AbstractController
cn.taketoday.web.handler.mvc.ParameterizableViewController
- 所有已实现的接口:
cn.taketoday.beans.factory.Aware,cn.taketoday.context.ApplicationContextAware,Controller,HttpRequestHandler
Trivial controller that always returns a pre-configured view and optionally
sets the response status code. The view and status can be configured using
the provided configuration properties.
- 从以下版本开始:
- 4.0 2022/2/8 15:48
- 作者:
- Rod Johnson, Juergen Hoeller, Keith Donald, Rossen Stoyanchev, Harry Yang
-
字段概要
字段从类继承的字段 cn.taketoday.web.WebContentGenerator
HEADER_CACHE_CONTROL, METHOD_GET, METHOD_HEAD, METHOD_POST从类继承的字段 cn.taketoday.context.support.ApplicationObjectSupport
applicationContext, log, messageSourceAccessor从接口继承的字段 cn.taketoday.web.HttpRequestHandler
NONE_RETURN_VALUE -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明private StringReturn the result object, ornullif we are not set.Return the configured HTTP status code ornull.getView()Return the View object, ornullif we are using a view name to be resolved by the DispatcherHandler via a ViewResolver.Return the name of the view to delegate to, ornullif using a View instance.protected ObjecthandleRequestInternal(RequestContext request) Return a ModelAndView object with the specified view name.booleanWhether the request is fully handled within the controller.voidsetContentType(String contentType) Set content typevoidsetReturnValue(Object returnValue) Set a result object to return.voidsetStatusCode(HttpStatusCode statusCode) Configure the HTTP status code that this controller should set on the response.voidsetStatusOnly(boolean statusOnly) The property can be used to indicate the request is considered fully handled within the controller and that no view should be used for rendering.voidSet a View object for the ModelAndView to return.voidsetViewName(String viewName) Set a view name for the ModelAndView to return, to be resolved by the DispatcherServlet via a ViewResolver.toString()从类继承的方法 cn.taketoday.web.handler.mvc.AbstractController
handleRequest, isSynchronizeOnSession, setSynchronizeOnSession从类继承的方法 cn.taketoday.web.WebContentGenerator
applyCacheControl, applyCacheSeconds, checkRequest, getAllowHeader, getCacheControl, getCacheSeconds, getSupportedMethods, getVaryByRequestHeaders, isRequireSession, prepareResponse, setCacheControl, setCacheSeconds, setRequireSession, setSupportedMethods, setVaryByRequestHeaders从类继承的方法 cn.taketoday.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, initApplicationContext, isContextRequired, obtainApplicationContext, requiredContextClass, setApplicationContext, unwrapContext, unwrapFactory
-
字段详细资料
-
returnValue
-
statusCode
-
statusOnly
private boolean statusOnly -
contentType
-
-
构造器详细资料
-
ParameterizableViewController
public ParameterizableViewController()
-
-
方法详细资料
-
setViewName
Set a view name for the ModelAndView to return, to be resolved by the DispatcherServlet via a ViewResolver. Will override any pre-existing view name or View. -
getViewName
Return the name of the view to delegate to, ornullif using a View instance. -
setView
Set a View object for the ModelAndView to return. Will override any pre-existing view name or View. -
getView
Return the View object, ornullif we are using a view name to be resolved by the DispatcherHandler via a ViewResolver. -
setStatusCode
Configure the HTTP status code that this controller should set on the response.When a "redirect:" prefixed view name is configured, there is no need to set this property since RedirectView will do that. However this property may still be used to override the 3xx status code of
RedirectView. For full control over redirecting provide aRedirectViewinstance.If the status code is 204 and no view is configured, the request is fully handled within the controller.
-
getStatusCode
Return the configured HTTP status code ornull. -
setStatusOnly
public void setStatusOnly(boolean statusOnly) The property can be used to indicate the request is considered fully handled within the controller and that no view should be used for rendering. Useful in combination withsetStatusCode(cn.taketoday.http.HttpStatusCode).By default this is set to
false. -
isStatusOnly
public boolean isStatusOnly()Whether the request is fully handled within the controller. -
setReturnValue
Set a result object to return. Will override any pre-existing view name or View. -
getReturnValue
Return the result object, ornullif we are not set. -
setContentType
Set content type -
getContentType
-
handleRequestInternal
Return a ModelAndView object with the specified view name.The content of the
RequestContext.getInputRedirectModel()"input" RedirectModel} is also added to the model.- 指定者:
handleRequestInternal在类中AbstractController- 抛出:
Throwable- 另请参阅:
-
toString
-
formatStatusAndView
-