Hi ccaning,
I usually use MultiAction, FormAction or Action classes of Spring Web Flow if I want to manipulate something in the web application context.
Example, if I want to have a reference of HttpServletRequest, I could easily do this,
Code:
public Event SampleEvent( RequestContext context )
{
HttpServletRequest request = ( (ServletExternalContext) context.getExternalContext() ).getRequest();
...
return success();
}
or if I want to have a reference to the formObject of FormAction so that I could put values to it if ever I'm editing an object I would do this...
Code:
public Event setupReferenceData( RequestContext context ) throws Exception
{
MutableAttributeMap flashScope = context.getFlashScope();
User user = (User) flashScope.get( "toBeEditedUser" );
UserBean formObject = (UserBean) getFormObject( context );
formObject.setUserId( user.getUserId() );
formObject.setAccess( user.getAccess() );
formObject.setEnabled( user.isEnabled() );
formObject.setPassword( user.getPassword() );
formObject.setUsername( user.getUsername() );
return success();
}
Basically <action bean> is used for pojo classes that are responsible for the business logic of the application.