You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by "Schachter, Michael" <MS...@Bluestone.com> on 2000/10/02 18:09:45 UTC
Volunteer: Enhanced Form Validation
I'd like to volunteer to improve the validate() method of
ValidatingActionForm in a way that
will preserve backwards compatibility.
The following method could be added to ValidatingActionForm to add the
ability to check more global form requirements:
public String[] validate(ActionServlet servlet, ActionMapping mapping,
HttpServletRequest request, HttpServletResponse response);
To preserve backwards compatibillity, the processValidate() method of
ActionServlet
could attempt to call this new method in a try block and catch an
AbstractMethodError
which would be thrown if the form class doesn't implement the new method.
In the
event that this error is caught, the old validate() method could be called.
I attached a file ActionServlet_processValidate.java demonstrating the
change to this
method.
<<ActionServlet_processValidate.java>>