org.springframework.web.servlet.config.annotation
Class ViewControllerRegistration

java.lang.Object
  extended by org.springframework.web.servlet.config.annotation.ViewControllerRegistration

public class ViewControllerRegistration
extends java.lang.Object

Encapsulates information required to create a view controller.

Since:
3.1
Author:
Rossen Stoyanchev, Keith Donald

Field Summary
private  java.lang.String urlPath
           
private  java.lang.String viewName
           
 
Constructor Summary
ViewControllerRegistration(java.lang.String urlPath)
          Creates a ViewControllerRegistration with the given URL path.
 
Method Summary
protected  java.lang.String getUrlPath()
          Returns the URL path for the view controller.
protected  java.lang.Object getViewController()
          Returns the view controllers.
 void setViewName(java.lang.String viewName)
          Sets the view name to use for this view controller.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

urlPath

private final java.lang.String urlPath

viewName

private java.lang.String viewName
Constructor Detail

ViewControllerRegistration

public ViewControllerRegistration(java.lang.String urlPath)
Creates a ViewControllerRegistration with the given URL path. When a request matches to the given URL path this view controller will process it.

Method Detail

setViewName

public void setViewName(java.lang.String viewName)
Sets the view name to use for this view controller. This field is optional. If not specified the view controller will return a null view name, which will be resolved through the configured RequestToViewNameTranslator. By default that means "/foo/bar" would resolve to "foo/bar".


getUrlPath

protected java.lang.String getUrlPath()
Returns the URL path for the view controller.


getViewController

protected java.lang.Object getViewController()
Returns the view controllers.