ATG Form handler Basic.

Answer:
1. If you are creating the custom formhandler, make sure it extends GenericeFomhandler.

2. In your custom formhandler must be define properties successURL, errorUrl and every property submitted with this formhandler  must be respectively getters/setters method.

3. Each Submit button should have a preXXX(),handleXXX() and validation () method. In preXXX() avoid the most of cases but if you needed to specifically clear formException vector, in the session scope component you can added you logic here.

4. Formhandlers scope must be request or session , request scope is always recommended. Sometimes we can define session scope.  

5. Each and every jsp page should be associated with one formhandler; it may be custom OOTB formhandler.

6. Formhandler should only refer to same scope or higher scope component i.e. session scope formhandler should never refer to any request scope component;

7. All page data should be passed through formhandler, avoid passing any attribute through request and session.

8. Set the priority of the field to "-10" for required input fields other than submit button, so that it gets invoked after all of the setters have been called.

9. Set  the priority of the field to “-10” for required input fields other then submit button ,so that it gets invoked after all of the setters have been called.

10.Return true to be redirect to success page, the follow will be something like this handleXXX(),preXXX()return super.checkfromRedirect(successURL,errorURL,request,responce);

2 comments:

Unknown said...

Hi Surya,

Really awesome document and it explains so well.


Thanks
le

Unknown said...

please could you provide sample example on custom formhandler