return new WrapperExceptionConfig(cfg);
}
public void convertErrors(ActionErrors errors, Object action) {
ValidationAware vaction = null;
TextProvider text = null;
if (action instanceof ValidationAware) {
vaction = (ValidationAware)action;
}
if (action instanceof TextProvider) {
text = (TextProvider)action;
}
// if there is no ValidationAware, it doesn't make sense to process messages
// as there be no place to put message in
if (vaction == null) {
return;
}
for (Iterator i = errors.properties(); i.hasNext(); ) {
String field = (String) i.next();
for (Iterator it = errors.get(field); it.hasNext(); ) {
ActionMessage error = (ActionMessage) it.next();
String msg = error.getKey();
if (error.isResource() && text != null) {
Object[] values = error.getValues();
if (values != null) {
msg = text.getText(error.getKey(), Arrays.asList(values));
} else {
msg = text.getText(error.getKey());
}
}
if (ActionMessages.GLOBAL_MESSAGE.equals(field)) {
vaction.addActionError(msg);
} else {