I just tried to generate json result by using Json plugin.
But I found that the result is cutted,not a well-formed json result.
After debugging ,I found the reason,one of my string property of the
struts action isn't a iso-8859-1 encoding string.
In the method "execute" of class JSONResult,you could find :
response.setContentLength(json.length);
response.setContentType("application/json;charset=" + getEncoding());
When the json.length is smller than json.getBytes(encoding).length,
the result will be cut.
So I thought maybe it's better to change json.length to
json.getBytes(encoding).length.
Moreover,I thought it's better if I could set which property to be
serialized in the struts.xml.It could be more flexible than the annotation.
For example:
<result type="json">
<param name="json.includeParam">name,email</param>
</result>