Top Description Fields Constructors Methods
org.springframework.web.servlet.config.annotation

public Class ViewControllerRegistration

extends Object
Class Inheritance
Imports
org.springframework.context.ApplicationContext, org.springframework.http.HttpStatusCode, org.springframework.lang.Nullable, org.springframework.util.Assert, org.springframework.web.servlet.RequestToViewNameTranslator, org.springframework.web.servlet.mvc.ParameterizableViewController

Assist with the registration of a single view controller.
Authors
Rossen Stoyanchev, Keith Donald
Since
3.1

Field Summary

Modifier and TypeField and Description
private final ParameterizableViewController
private final String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected String
protected ParameterizableViewController
protected void
public ViewControllerRegistration
setStatusCode(HttpStatusCode statusCode)

Set the status code to set on the response.

public void
setViewName(String viewName)

Set the view name to return.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

controllerback to summary
private final ParameterizableViewController controller
urlPathback to summary
private final String urlPath

Constructor Detail

ViewControllerRegistrationback to summary
public ViewControllerRegistration(String urlPath)

Method Detail

getUrlPathback to summary
protected String getUrlPath()
getViewControllerback to summary
protected ParameterizableViewController getViewController()
setApplicationContextback to summary
protected void setApplicationContext(ApplicationContext applicationContext)
setStatusCodeback to summary
public ViewControllerRegistration setStatusCode(HttpStatusCode statusCode)

Set the status code to set on the response. Optional.

If not set the response status will be 200 (OK).

setViewNameback to summary
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 configured RequestToViewNameTranslator will select the view name. The DefaultRequestToViewNameTranslator for example translates "/foo/bar" to "foo/bar".

See Also
org.springframework.web.servlet.view.DefaultRequestToViewNameTranslator