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 Details

    • ViewControllerRegistration

      public ViewControllerRegistration(String urlPath)
  • Method Details

    • setStatusCode

      public ViewControllerRegistration setStatusCode(org.springframework.http.HttpStatusCode 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 configured RequestToViewNameTranslator will select the view name. The DefaultRequestToViewNameTranslator for example translates "/foo/bar" to "foo/bar".

      See Also:
    • setApplicationContext

      protected void setApplicationContext(@Nullable org.springframework.context.ApplicationContext applicationContext)
    • getUrlPath

      protected String getUrlPath()
    • getViewController

      protected ParameterizableViewController getViewController()