Hi folks,
I'm in love with the validation framework included with Struts. The
fact that I can do validation with regular expressions and have
client-side JavaScript created for me automatically is fantastic.
However, there's one error that I have to catch on the server-side in
some cases: an attempt to create a duplicate entity. In this case, I'd
like an error message to appear close to the form input for which it
applies.
So I'm creating an ActionError in my Action and saving it as follows:
} catch (DuplicateDomainAliasError e) {
ActionErrors errors = new ActionErrors();
ActionError error = new ActionError("error.domainAliasName.exists");
errors.add("domainAliasName", error);
saveErrors(request, errors);
}
I have error.domainAliasName.exists in my message bundle:
error.domainAliasName.exists=A domain alias with that name already exists.
Because domainAliasName is a property of the ActionForm associated with
the <html:form/> I have in my JSP, I expect the message to be displayed
with the following tag:
<html:errors property="domainAliasName"/>
However, that tag renders the empty string.
Can someone point out what I'm doing wrong here? I can get the error
displayed at the top of the page by using declarative exception
handling, but the page has a lot of stuff on it, and I'd like the error
displayed close to the form input that it relates to.
Thanks,
Sheldon.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]