日期:2014-05-16 浏览次数:20362 次
<struts> <constant name="struts.objectFactory" value="spring"/> <include file="struts-admin.xml"></include> <package name="default" extends="json-default"> <action name="person" class="com.person.PersonAction" method="view"> <result type="json"> <param name="includeProperties"> person\.name,persoon\.age,person\.gender </param> </result> </action> </package> </struts>
<struts> <constant name="struts.objectFactory" value="spring"/> <include file="struts-admin.xml"></include> <package name="default" extends="json-default"> <action name="person" class="com.person.PersonAction" method="view"> <result type="json"> <param name="includeProperties"> person\[\d+\]\.person1 </param>> </result> </action> </package> </struts>
<struts> <constant name="struts.objectFactory" value="spring"/> <include file="struts-admin.xml"></include> <package name="default" extends="json-default"> <action name="person" class="com.person.PersonAction" method="view"> <result type="json"> <param name="excludeProperties"> person </param>> </result> </action> </package> </struts>
@JSON(name="newName") public String getName() { return this.name; }
@JSON(serialize=false) public User getUser() { return this.User; } @JSON(format="yyyy-MM-dd") public Date getStartDate() { return this.startDate; }