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):
- Render request is received by the controller
- 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 Methods |
From class
org.springframework.web.portlet.mvc.AbstractController
void
|
handleActionRequest(ActionRequest request, ActionResponse response)
Process the action request.
|
void
|
handleActionRequestInternal(ActionRequest request, ActionResponse response)
Subclasses are meant to override this method if the controller
is expected to handle action requests.
|
ModelAndView
|
handleRenderRequest(RenderRequest request, RenderResponse response)
Process the render request and return a ModelAndView object which the DispatcherPortlet
will render.
|
ModelAndView
|
handleRenderRequestInternal(RenderRequest request, RenderResponse response)
Subclasses are meant to override this method if the controller
is expected to handle render requests.
|
final
boolean
|
isRenderWhenMinimized()
Return whether controller will render when portlet is minimized.
|
final
boolean
|
isSynchronizeOnSession()
Return whether controller execution should be synchronized on the session.
|
final
void
|
setRenderWhenMinimized(boolean renderWhenMinimized)
Set if the controller should render an view when the portlet is in
a minimized window.
|
final
void
|
setSynchronizeOnSession(boolean synchronizeOnSession)
Set if controller execution should be synchronized on the session,
to serialize parallel invocations from the same client.
|
|
From class
org.springframework.web.portlet.handler.PortletContentGenerator
final
void
|
applyCacheSeconds(MimeResponse response, int seconds)
Apply the given cache seconds to the render response
|
final
void
|
cacheForSeconds(MimeResponse response, int seconds)
Set portlet response to allow caching for the given number of seconds.
|
final
void
|
check(PortletRequest request, PortletResponse response)
Check and prepare the given request and response according to the settings
of this generator.
|
final
void
|
checkAndPrepare(PortletRequest request, MimeResponse response)
Check and prepare the given request and response according to the settings
of this generator.
|
final
void
|
checkAndPrepare(PortletRequest request, MimeResponse response, int cacheSeconds)
Check and prepare the given request and response according to the settings
of this generator.
|
final
int
|
getCacheSeconds()
Return the number of seconds that content is cached.
|
final
boolean
|
isRequireSession()
Return whether a session is required to handle requests.
|
final
void
|
preventCaching(MimeResponse response)
Prevent the render response from being cached.
|
final
void
|
setCacheSeconds(int seconds)
Cache content for the given number of seconds.
|
final
void
|
setRequireSession(boolean requireSession)
Set whether a session should be required to handle requests.
|
|
From class
org.springframework.web.portlet.context.PortletApplicationObjectSupport
final
PortletContext
|
getPortletContext()
Return the current PortletContext.
|
final
File
|
getTempDir()
Return the temporary directory for the current web application,
as provided by the servlet container.
|
boolean
|
isContextRequired()
Overrides the base class behavior to enforce running in an ApplicationContext.
|
void
|
setPortletContext(PortletContext portletContext)
Set the PortletContext that this object runs in.
|
|
From class
org.springframework.context.support.ApplicationObjectSupport
|
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
|
From interface
org.springframework.context.ApplicationContextAware
|
From interface
org.springframework.web.portlet.context.PortletContextAware
abstract
void
|
setPortletContext(PortletContext portletContext)
Set the PortletContext that this object runs in.
|
|
From interface
org.springframework.web.portlet.mvc.Controller
abstract
void
|
handleActionRequest(ActionRequest request, ActionResponse response)
Process the action request.
|
abstract
ModelAndView
|
handleRenderRequest(RenderRequest request, RenderResponse response)
Process the render request and return a ModelAndView object which the DispatcherPortlet
will render.
|
|
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.
protected
void
initApplicationContext
()