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 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.
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
null
as the view name in which case the configuredRequestToViewNameTranslator
will select the view name. TheDefaultRequestToViewNameTranslator
for example translates "/foo/bar" to "foo/bar".- See Also:
DefaultRequestToViewNameTranslator
setApplicationContext
protected void setApplicationContext(@Nullable ApplicationContext applicationContext)
getUrlPath
protected String getUrlPath()
getViewController
protected ParameterizableViewController getViewController()