Monday, 11 April 2016

What is the ActionForm? What are the important methods of ActionForm ?


ActionForm is java bean which represents the form inputs containing the request parameters from the view referencing the Action bean.

The important methods of ActionForm are : validate() and reset()

validate() 

  • validate properties after they have been populated
  • called before FormBean is handed to Action and returns a collection of ActionError as ActionErrors
  • Syntax
    public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) { }

reset() 

  • called with each request that uses ActionForm
  • reset all data members of ActionForm prior to the new request values being set
  • Syntax
    public void reset() { }

No comments:

Post a Comment

Note: only a member of this blog may post a comment.