atg form handler basics
Whenever if you are creating a custom form handler,make sure it extend GenericFormHandler class.
Your custom form handler must define properties successUrl and errorUrl with the respectieve getters and setters methods.
Other than this every property submitted with this formhandlers
must have the respectieve getters and setters methods.
Each submit button should have a prexx(), handlexxx() and validate() methods
The prexxx() method will be void most of the cases,but if you need
to specifically clear the formException vector,in case of session
scoped components you can add your logic here.
validate method should validate the properties as per the requirement,incase of validation failure,create a new DropletException and add it to the formException Vector.
eg:super.addFormException(new DropletFormException(msg, "key"));
The flow will be something like this,handlexxx()-prexxx()-return super.checkFormRedirect(successUrl,errorUrl,request,response).
Also verify FormHandler Best Practices
Comments
Post a Comment