*/
private ActionMessages getActionMessages() {
ActionMessages actionMessages = new ActionMessages();
Iterator it = this.errors.getAllErrors().iterator();
while (it.hasNext()) {
ObjectError objectError = (ObjectError) it.next();
String effectiveMessageKey = findEffectiveMessageKey(objectError);
if (effectiveMessageKey == null && !defaultActionMessageAvailable) {
// Need to specify default code despite it not being resolvable:
// Struts 1.1 ActionMessage doesn't support default messages.
effectiveMessageKey = objectError.getCode();
}
ActionMessage message = (effectiveMessageKey != null) ?
new ActionMessage(effectiveMessageKey, resolveArguments(objectError.getArguments())) :
new ActionMessage(objectError.getDefaultMessage(), false);
if (objectError instanceof FieldError) {
FieldError fieldError = (FieldError) objectError;
actionMessages.add(fieldError.getField(), message);
}
else {