The consequence of a mentawai result can be a chain to another action. For example, one action may update an user profile and then chain to the action that displays it.
To define action chaining in mentawai, you use the org.mentawai.core.Chain which inherits from org.mentawai.core.Consequence. Check the ApplicationManager code below for an example:
public class ApplicationManager extends org.mentawai.core.ApplicationManager { public void loadActions() { ActionConfig ac2 = new ActionConfig("/Action2", Action2.class); ac2.addConsequence(Action2.SUCCESS, new Forward("/show.jsp")); addActionConfig(ac2); ActionConfig ac1 = new ActionConfig("/Action1", Action1.class); ac1.addConsequence(Action1.SUCCESS, new Chain(ac2)); addActionConfig(ac1); } }
Important things you should know about action chaining: