struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Ferguson <>
Subject Excluding Fields From JSON Serialization via Annoations
Date Sun, 03 Oct 2010 14:30:24 GMT
I have a class called BorderPoint with about 5 fields (including an id field
and two ManyToOne hibernate fields).

When I return the JSON, there is a large collection of BorderPoints (often
over 1000). I'd like to exclude everything but two float fields from the
JSON serialization, if only to make the returned JSON a bit smaller.

I also need to do it via annotations.

So, assuming the BorderPoint class has the following code snippet, how do I
exclude this field?

    private int id;

    public int getId() {}

    public void setIt(int id) {}


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message