struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marshall Gunter <marsh...@mate1inc.com>
Subject Displaying maps with JSON plugin
Date Sat, 22 May 2010 17:19:08 GMT
I'm using Struts-2.1.8.1's JSON plugin to try and display the field 
errors that are accrued by the validation interceptor. What I've got is 
this:

Java snippet from the action:

public Map getAllErrors()
{
         return getFieldErrors();
}

public String getNewEmail()
{
         return this.newEmail;
}

The result type snippet is this:

<result name="error" type="json">
<param name="includeProperties">allErrors</param>
</result>


This is the result I get when I fire a blank email address (the 
validator is requiredstring):
{"allErrors":{}}



Now, when I change the result type snippet to this:

<result name="error" type="json">
<param name="excludeProperties">newEmail</param>
</result>


I get this result:

{"allErrors":{"newEmail":["No email address submitted"]}}


I'm confused by this.

Any help is appreciated =)

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message