Saturday, April 10, 2010

Page Flows

Controller: Controller are composed of methods and their respective actions. Every incoming request is intercepted by a method in controller and performs business logic and return a Forwards object to an action.

libraries:
import org.apache.beehive.netui.pageflow.PageFlowController;
import org.apache.beehive.netui.pageflow.annotation.Jpf;

Every controller should start with an annotation
@Jpf.Controller
public class controller extends PageFlowController
{}

There are two basic ways of Actions:
1)simple action
2)action method

Simple Actions are class-level annotations. These are declared above class with in controller annotation.
@Jpf.Controller
{
simpleAction={@Jpf.simpleAction(name="" ,path="-----.jsp",[other properties])}
}
public class controller extends PageFlowController
{}

simple action can handle navigation, form submission and form validation. It can not handle decision logic. For decision logic we use action methods.

Action Methods can handle navigation, form submission, form validation, data validation and decision logic. Action Methods return Forward object and decorated with @Jpf.Action annotation.
@Jpf.Action{
forwards={@Jpf.Forward(name="" ,path="-----.jsp",[other properties])}
}
public class controller extends PageFlowController
{}