You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by John Nikolai <jn...@is2inc.com> on 2003/06/03 01:10:08 UTC
Default ActionError message...
Hi fellow Struts users!
We are using Verisign to validate a users credit card. There are
several error codes which can be returned but we don't wish to map
every single one of these error code in the properties file. I would
like to do something like the following where resultCode is what is
returned from Verisign servers (at this point in the code, we know
Verisign has returned an error so the resultCode will contain the error
number) :
String resultCode = result.getParameter(result.RESULT);
errors.add(ActionErrors.GLOBAL_ERROR, new ActionError(resultCode));
saveErrors(request, errors);
This works fine if the resultCode is mapped in the properties file but
breaks if the it is not there. What I would like to do is use a default
error message if the resultCode is not contained in the properties
file. This will allow us to add error codes to the properties file as
needed...
Short of creating a local properties object, reading in the properties
and searching to see if it exists is there a better solution?
Thank you for your help,
- John
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org