See the answer here which shows the use of include and exclude properties. I don't think the example clearly shows excluding nested objects however I have used it for this purpose. If you still have issues I'll post a regex which will demonstrate this.
Problem with Json plugin in Struts 2
Edit:
Here is an example of using exclude properties in an annotation which blocks the serialization of a nested member:
@ParentPackage("json-default")
@Result(type = "json", params = {
"excludeProperties",
"^inventoryHistory\[\d+\]\.intrnmst, selectedTransactionNames, transactionNames"
})
public class InventoryHistoryAction extends ActionSupport {
...
inventoryHistory is of type InventoryHistory a JPA entity object, intrnmst references another table but because of lazy loading if it were serialized it would cause an Exception when the action is JSON serialized for this reason the exclude parameter has been added to prevent this.
Note that
\
is required for each character, so a single would only be used in the xml where two are required because of escaping for the string to be parsed right.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…