Class VelocityAction
java.lang.Object
org.apache.turbine.modules.ActionEvent
org.apache.turbine.util.velocity.VelocityActionEvent
org.apache.turbine.modules.actions.VelocityAction
- Direct Known Subclasses:
LegacyVelocityAction
,VelocitySecureAction
This class provides a convenience methods for Velocity Actions to use. Since
this class is abstract, it should only be extended and not used directly.
- Version:
- $Id$
- Author:
- Jon S. Stevens, Jason van Zyl, Peter Courcoux
-
Field Summary
Fields inherited from class org.apache.turbine.util.velocity.VelocityActionEvent
initialized, velocity
Fields inherited from class org.apache.turbine.modules.ActionEvent
bubbleUpException, BUTTON, BUTTON_LENGTH, DEFAULT_METHOD, LENGTH, log, METHOD_NAME_LENGTH, METHOD_NAME_PREFIX
Fields inherited from interface org.apache.turbine.modules.Action
CACHE_SIZE_DEFAULT, CACHE_SIZE_KEY, NAME, PREFIX
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract void
doPerform
(PipelineData pipelineData, org.apache.velocity.context.Context context) You SHOULD override this method and implement it in your action.void
Initialize the module.void
perform
(PipelineData pipelineData) Sets up the context and then calls super.perform(); thus, subclasses don't have to worry about getting a context themselves!void
setTemplate
(PipelineData pipelineData, String template) This method is used when you want to short circuit an Action and change the template that will be executed next.Methods inherited from class org.apache.turbine.util.velocity.VelocityActionEvent
doPerform
Methods inherited from class org.apache.turbine.modules.ActionEvent
considerKey, executeEvents, formatString, getMethod
-
Constructor Details
-
VelocityAction
public VelocityAction()
-
-
Method Details
-
initialize
Initialize the module.- Specified by:
initialize
in classVelocityActionEvent
- Throws:
Exception
- a generic exception.
-
doPerform
public abstract void doPerform(PipelineData pipelineData, org.apache.velocity.context.Context context) throws Exception You SHOULD override this method and implement it in your action.- Parameters:
pipelineData
- Turbine information.context
- Context for web pages.- Throws:
Exception
- a generic exception.
-
perform
Sets up the context and then calls super.perform(); thus, subclasses don't have to worry about getting a context themselves! If a subclass throws an exception then depending on whether action.event.bubbleexception is true, then it bubbles it farther up, or traps it there.- Parameters:
pipelineData
- Turbine information.- Throws:
Exception
- a generic exception.
-
setTemplate
This method is used when you want to short circuit an Action and change the template that will be executed next.- Parameters:
pipelineData
- Turbine information.template
- The template that will be executed next.
-