com.ervacon.springframework.web.servlet.mvc.webflow
Interface Action

All Known Implementing Classes:
BindAndValidateCommandAction, MultiAction, SignalEventAction

public interface Action

Interface for actions executed by a web flow. Actions are executed in an action-state of the web flow. They signal an event that allows the flow to continue.

Actions are configured as beans in a Spring application context. An action that is configured as a singleton bean in the application context should be thread safe! If you have an action that is not thread safe, make sure you add the singleton="false" parameter to its bean definition.
If an action needs access to the application context, it can implement an interface like ApplicationContextAware.

Author:
Erwin Vervaet
See Also:
WebFlow, ApplicationContext, ApplicationContextAware

Field Summary
static java.lang.String ERROR
          Name of the event used to indicate that action processing encountered an error.
static java.lang.String OK
          Name of the event used to indicate that action processing was ok.
 
Method Summary
 java.lang.String execute(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.util.Map model)
          Execute the action and return and signal an event that allows the containing flow to continue.
 

Field Detail

OK

public static final java.lang.String OK
Name of the event used to indicate that action processing was ok. You are not required to use this, this is just the conventional name used for such an event.

See Also:
Constant Field Values

ERROR

public static final java.lang.String ERROR
Name of the event used to indicate that action processing encountered an error. You are not required to use this, this is just the conventional name used for such an event.

See Also:
Constant Field Values
Method Detail

execute

public java.lang.String execute(javax.servlet.http.HttpServletRequest request,
                                javax.servlet.http.HttpServletResponse response,
                                java.util.Map model)

Execute the action and return and signal an event that allows the containing flow to continue. A null return value is not allowed: an action must return a valid event!

Note that actions cannot throw checked exceptions. They should signal an appropriate event or wrap the exception in a runtime exception.

Parameters:
request - current HTTP request
response - current HTTP response
model - model of the flow
Returns:
event that is signaled by the action, cannot be null