Save This Page
Home » spring-framework-2.5.5-with-dependencies » org.springframework » web » servlet » mvc » [javadoc | source]
org.springframework.web.servlet.mvc
public class: ParameterizableViewController [javadoc | source]
java.lang.Object
   org.springframework.context.support.ApplicationObjectSupport
      org.springframework.web.context.support.WebApplicationObjectSupport
         org.springframework.web.servlet.support.WebContentGenerator
            org.springframework.web.servlet.mvc.AbstractController
               org.springframework.web.servlet.mvc.ParameterizableViewController

All Implemented Interfaces:
    Controller, ServletContextAware, ApplicationContextAware

Trivial controller that always returns a named view. The view can be configured using an exposed configuration property. This controller offers an alternative to sending a request straight to a view such as a JSP. The advantage here is that the client is not exposed to the concrete view technology but rather just to the controller URL; the concrete view will be determined by the ViewResolver.

An alternative to the ParameterizableViewController is a MultiActionController , which can define a variety of handler methods that just return a plain ModelAndView instance for a given view name.

Workflow (and that defined by superclass):

  1. Request is received by the controller
  2. call to handleRequestInternal which just returns the view, named by the configuration property viewName. Nothing more, nothing less

Exposed configuration properties (and those defined by superclass):
name default description
viewName null the name of the view the viewResolver will use to forward to (if this property is not set, an exception will be thrown during initialization)

Fields inherited from org.springframework.web.servlet.support.WebContentGenerator:
METHOD_GET,  METHOD_HEAD,  METHOD_POST
Fields inherited from org.springframework.context.support.ApplicationObjectSupport:
logger
Method from org.springframework.web.servlet.mvc.ParameterizableViewController Summary:
getViewName,   handleRequestInternal,   initApplicationContext,   setViewName
Methods from org.springframework.web.servlet.mvc.AbstractController:
handleRequest,   handleRequestInternal,   isSynchronizeOnSession,   setSynchronizeOnSession
Methods from org.springframework.web.servlet.support.WebContentGenerator:
applyCacheSeconds,   applyCacheSeconds,   cacheForSeconds,   cacheForSeconds,   checkAndPrepare,   checkAndPrepare,   getCacheSeconds,   getSupportedMethods,   isRequireSession,   isUseCacheControlHeader,   isUseCacheControlNoStore,   isUseExpiresHeader,   preventCaching,   setCacheSeconds,   setRequireSession,   setSupportedMethods,   setUseCacheControlHeader,   setUseCacheControlNoStore,   setUseExpiresHeader
Methods from org.springframework.web.context.support.WebApplicationObjectSupport:
getServletContext,   getTempDir,   getWebApplicationContext,   initApplicationContext,   initServletContext,   isContextRequired,   setServletContext
Methods from org.springframework.context.support.ApplicationObjectSupport:
getApplicationContext,   getMessageSourceAccessor,   initApplicationContext,   initApplicationContext,   isContextRequired,   requiredContextClass,   setApplicationContext
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.springframework.web.servlet.mvc.ParameterizableViewController Detail:
 public String getViewName() 
    Return the name of the view to delegate to.
 protected ModelAndView handleRequestInternal(HttpServletRequest request,
    HttpServletResponse response) throws Exception 
    Return a ModelAndView object with the specified view name.
 protected  void initApplicationContext() 
 public  void setViewName(String viewName) 
    Set the name of the view to delegate to.