类 ViewControllerRegistration
- java.lang.Object
- org.springframework.web.servlet.config.annotation.ViewControllerRegistration
public class ViewControllerRegistration extends Object
Assist with the registration of a single view controller.- 从以下版本开始:
- 3.1
- 作者:
- Rossen Stoyanchev, Keith Donald
构造器概要
构造器 构造器 说明 ViewControllerRegistration(String urlPath)
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected String
getUrlPath()
protected ParameterizableViewController
getViewController()
protected void
setApplicationContext(ApplicationContext applicationContext)
ViewControllerRegistration
setStatusCode(HttpStatus statusCode)
Set the status code to set on the response.void
setViewName(String viewName)
Set the view name to return.
构造器详细资料
ViewControllerRegistration
public ViewControllerRegistration(String urlPath)
方法详细资料
setStatusCode
public ViewControllerRegistration setStatusCode(HttpStatus statusCode)
Set the status code to set on the response. Optional.If not set the response status will be 200 (OK).
setViewName
public void setViewName(String viewName)
Set the view name to return. Optional.If not specified, the view controller will return
null
as the view name in which case the configuredRequestToViewNameTranslator
will select the view name. TheDefaultRequestToViewNameTranslator
for example translates "/foo/bar" to "foo/bar".
setApplicationContext
protected void setApplicationContext(ApplicationContext applicationContext)
getUrlPath
protected String getUrlPath()
getViewController
protected ParameterizableViewController getViewController()