struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Nikolai <>
Subject Default ActionError message...
Date Mon, 02 Jun 2003 23:10:08 GMT

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 

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:
For additional commands, e-mail:

View raw message