|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.norther.tammi.spray.loader.task.Action org.norther.tammi.spray.loader.task.Submit
public abstract class Submit
Submit is an alternative to Action that allows you to do event based submits. Essentially, you label all your submit buttons and methods with the prefix of "submit". For example, "submitDelete". Then any class that subclasses this class will get its submitDelete method executed.
If the named submit method was not implemented, it executes the generic submit method, named "submit", which it implements as a nop.
Methods returning Task$Control may act as submit methods, too, without specific naming rules.
Based on ActionEvent
in the Apache Jakarta Turbine project.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.norther.tammi.spray.loader.task.Task |
---|
Task.Control |
Field Summary | |
---|---|
static String |
EXECUTE_METHOD
The execute method itself to discard. |
static String |
SUBMIT_PREFIX
The prefix of the submit method to look for. |
Constructor Summary | |
---|---|
Submit()
Constructs a new action event. |
Method Summary | |
---|---|
Task.Control |
execute(ServletRequest request,
ServletResponse response,
FilterChain chain,
Object context)
Executes customized functionality. |
protected Method |
getAction(Map<String,String[]> params,
String... className)
Gets the qualified submit method present in a parameter map. |
protected Method |
getAction(String action)
Gets the named submit method. |
protected Class<?>[] |
getSignature()
Gets the action class specific signature. |
void |
initialize(ServletRequest request,
ServletResponse response,
FilterChain chain,
Object context)
Initializes customized functionality after construction but before the first execution. |
protected Task.Control |
invoke(Method method,
Object[] args,
ServletRequest request,
ServletResponse response,
FilterChain chain,
Object context)
Invokes a method. |
Task.Control |
submit(ServletRequest request,
ServletResponse response,
FilterChain chain,
Object context)
Implements the default submit method if the specific one is not implemented. |
Methods inherited from class org.norther.tammi.spray.loader.task.Action |
---|
find, find, getFilter, getMBeanServer |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String SUBMIT_PREFIX
public static final String EXECUTE_METHOD
Constructor Detail |
---|
public Submit()
Method Detail |
---|
public void initialize(ServletRequest request, ServletResponse response, FilterChain chain, Object context)
Task
initialize
in interface Task
initialize
in class Action
request
- the request.response
- the response.chain
- the filter chain.context
- a task specific context.public Task.Control execute(ServletRequest request, ServletResponse response, FilterChain chain, Object context) throws Exception
Task
execute
in interface Task
execute
in class Action
request
- the request.response
- the response.chain
- the filter chain.context
- a task specific context.
Exception
- on errors.public Task.Control submit(ServletRequest request, ServletResponse response, FilterChain chain, Object context) throws Exception
request
- the request.response
- the response.chain
- the filter chain.context
- the context.
Exception
- on errors.protected Task.Control invoke(Method method, Object[] args, ServletRequest request, ServletResponse response, FilterChain chain, Object context) throws Exception
method
- the method.args
- the arguments.request
- the request.response
- the response.chain
- the filter chain.context
- the context.
Exception
- on errors.protected Method getAction(String action)
action
- the action name.
protected Method getAction(Map<String,String[]> params, String... className)
An optional class name is appended to the action parameter name to get a qualified submit method. If a qualified method is not available, the class name is removed and a non-qualified method returned.
params
- the parameter map.className
- an optional class name.
protected Class<?>[] getSignature()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |