org.springframework.web.portlet.mvc |
Standard controller implementations for the portlet MVC framework that
comes with Spring. Provides both abstract base classes and concrete
implementations for often seen use cases.
A Controller - as defined in this package - is analogous to a Struts
Action . Usually Controllers are JavaBeans
to allow easy configuration using the {@link org.springframework.beans org.springframework.beans}
package. Controllers define the C from so-called MVC paradigm
and can be used in conjunction with the {@link org.springframework.web.portlet.ModelAndView ModelAndView}
to achieve interactive applications. The view might be represented by a
HTML interface, but, because of model and the controller being completely
independent of the view, PDF views are possible, as well as for instance Excel
views.
Especially useful to read, while getting into the Spring MVC framework
are the following:
|
Java Source File Name | Type | Comment |
AbstractCommandController.java | Class | Abstract base class for custom command controllers. |
AbstractController.java | Class | Convenient superclass for controller implementations, using the Template
Method design pattern.
As stated in the
Controller Controller interface, a lot of functionality is already provided by certain abstract
base controllers. |
AbstractFormController.java | Class | Form controller that auto-populates a form bean from the request.
This, either using a new bean instance per request, or using the same bean
when the sessionForm property has been set to
true .
This class is the base class for both framework subclasses like
SimpleFormController SimpleFormController and
AbstractWizardFormController AbstractWizardFormController , and
custom form controllers you can provide yourself.
Both form-input-views and after-submission-views have to be provided
programmatically. |
AbstractWizardFormController.java | Class | Form controller for typical wizard-style workflows.
In contrast to classic forms, wizards have more than one form view page.
Therefore, there are various actions instead of one single submit action:
- finish: trying to leave the wizard successfully, i.e.
|
BaseCommandController.java | Class | Controller implementation which creates an object (the command object) on
receipt of a request and attempts to populate this object with request parameters.
This controller is the base for all controllers wishing to populate
JavaBeans based on request parameters, validate the content of such
JavaBeans using
Validator Validators and use custom editors (in the form of
java.beans.PropertyEditor PropertyEditors ) to transform
objects into strings and vice versa, for example. |
Controller.java | Interface | Base portlet Controller interface, representing a component that receives
RenderRequest/RenderResponse and ActionRequest/ActionResponse like a
Portlet but is able to participate in an MVC workflow.
Any implementation of the portlet Controller interface should be a
reusable, threadsafe class, capable of handling multiple
portlet requests throughout the lifecycle of an application. |
ParameterizableViewController.java | Class | Trivial controller that always returns a named view. |
PortletModeNameViewController.java | Class | Trivial controller that transforms the PortletMode to a view name.
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.
Example: PortletMode.VIEW -> "view"
This controller does not handle action requests.
author: William G. |
PortletWrappingController.java | Class | Controller implementation that wraps a portlet instance which it manages
internally. |
SimpleControllerHandlerAdapter.java | Class | Adapter to use the Controller workflow interface with the generic DispatcherPortlet.
This is an SPI class, not used directly by application code.
author: John A. |
SimpleFormController.java | Class | Concrete FormController implementation that provides configurable
form and success views, and an onSubmit chain for convenient overriding.
Automatically resubmits to the form view in case of validation errors,
and renders the success view in case of a valid submission.
The workflow of this Controller does not differ much from the one described
in the
AbstractFormController AbstractFormController . |