I use GSON serialize POJO -- both the object before and after altered.
The altered one (call it A) which is setup by Struts2 could easily serialized to Json.
<
Brandon was right. Here is another solution if you don't want to use any annotation or modify your POJO class. This may help for any other guys.
Type typeOfSrc = new TypeToken() {}.getType(); //this helps for generic one.
gson.toJson(obj, typeOfSrc); or gson.toJson(obj, A.class);