Class 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.- Since:
- 3.1
- Author:
- Rossen Stoyanchev, Keith Donald
Constructor Summary
Constructors Constructor Description ViewControllerRegistration(String urlPath)
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringgetUrlPath()protected ParameterizableViewControllergetViewController()protected voidsetApplicationContext(ApplicationContext applicationContext)ViewControllerRegistrationsetStatusCode(HttpStatus statusCode)Set the status code to set on the response.voidsetViewName(String viewName)Set the view name to return.
Constructor Detail
ViewControllerRegistration
public ViewControllerRegistration(String urlPath)
Method Detail
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
nullas the view name in which case the configuredRequestToViewNameTranslatorwill select the view name. TheDefaultRequestToViewNameTranslatorfor example translates "/foo/bar" to "foo/bar".- See Also:
DefaultRequestToViewNameTranslator
setApplicationContext
protected void setApplicationContext(ApplicationContext applicationContext)
getUrlPath
protected String getUrlPath()
getViewController
protected ParameterizableViewController getViewController()