You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Peter Bliznak <bl...@rogers.com> on 2008/08/02 04:53:02 UTC
Struts2 validation
Hi all,
converting big S1 application and run into this problem.
Even though form is being validated in S1 version by validator.xml
there is an user field which was validated on focus lost by asynch call using Ajax - to find found if by user chosen
user name is still available. Call is then intercepted and handled in S1 ACTION with following construct
if (nameTaken) {
msg = new ActionMessage(NAME_TAKEN);
error = addMsgErrors(error,Constants.NAME_ERROR, msg);
this.addErrors(request, error);
return mapping.getInputForward();
}.
My question is - provided asynch check must stay - how to handle this in S2 -
or what is best practice to handle such a case - to create validation error programmatically?
Thanks,
Peter