you can use the JSON Annotion above the field you want to exclude.

@JSON(serialize=false)
public List<XXX> getXxx() {}


Johannes



DartmanX wrote:
> 
> 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) {}
> 
> Thanks,
> Jason
> 
> 


-----
---
web: http://www.jgeppert.com
twitter: http://twitter.com/jogep

-- 
View this message in context: 
http://old.nabble.com/Excluding-Fields-From-JSON-Serialization-via-Annoations-tp29871613p29873234.html
Sent from the Struts - User mailing list archive at Nabble.com.


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

Reply via email to