public class

ParameterizableViewController

extends AbstractController
java.lang.Object
   ↳ org.springframework.context.support.ApplicationObjectSupport
     ↳ org.springframework.web.portlet.context.PortletApplicationObjectSupport
       ↳ org.springframework.web.portlet.handler.PortletContentGenerator
         ↳ org.springframework.web.portlet.mvc.AbstractController
           ↳ org.springframework.web.portlet.mvc.ParameterizableViewController

Class Overview

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.

Workflow (and that defined by superclass):

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

This controller does not handle action requests.

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)

Summary

[Expand]
Inherited Fields
From class org.springframework.context.support.ApplicationObjectSupport
Public Constructors
ParameterizableViewController()
Public Methods
String getViewName()
Return the name of the view to delegate to.
void setViewName(String viewName)
Set the name of the view to delegate to.
Protected Methods
ModelAndView handleRenderRequestInternal(RenderRequest request, RenderResponse response)
Return a ModelAndView object with the specified view name.
void initApplicationContext()
Subclasses can override this for custom initialization behavior.
[Expand]
Inherited Methods
From class org.springframework.web.portlet.mvc.AbstractController
From class org.springframework.web.portlet.handler.PortletContentGenerator
From class org.springframework.web.portlet.context.PortletApplicationObjectSupport
From class org.springframework.context.support.ApplicationObjectSupport
From class java.lang.Object
From interface org.springframework.context.ApplicationContextAware
From interface org.springframework.web.portlet.context.PortletContextAware
From interface org.springframework.web.portlet.mvc.Controller

Public Constructors

public ParameterizableViewController ()

Public Methods

public String getViewName ()

Return the name of the view to delegate to.

public void setViewName (String viewName)

Set the name of the view to delegate to.

Protected Methods

protected ModelAndView handleRenderRequestInternal (RenderRequest request, RenderResponse response)

Return a ModelAndView object with the specified view name.

Throws
Exception

protected void initApplicationContext ()

Subclasses can override this for custom initialization behavior.

The default implementation is empty. Called by initApplicationContext(org.springframework.context.ApplicationContext).