Example Action:
public class HelloWorldAction extends JetAction{
public void execute( JetMessages messages, JetData data, JetForm form, JetContext jetContext )
throws JetActionException, IOException{
if(form != null){ //test2.jet called
data.add( "newform", form.decodeForm(jetContext) );
}else{ //test.jet called
data.add( "newform", jetContext.getFormByUrl("/test2.jet").decodeForm(jetContext) );
}
render( data, "jet.ftl.pages.helloworld" );
}
}
Example Action:
public class NewBehaveAction {
public void myexecute( JetData data, JetForm form, JetContext jetContext )
throws JetActionException, IOException{
if(form != null){ //test2.jet called
data.add( "newform", form.decodeForm(jetContext) );
}else{ //test.jet called
data.add( "newform", jetContext.getFormByUrl("/test2.jet").decodeForm(jetContext) );
}
context.render( data, "jet.ftl.pages.helloworld" );
}
}
NOTE: The new behave supports no special 'validate' method. Form validation is the same.