代码:
public List<User> list;//通过json返回的数据
struts配置文件:
1 <action name="test" class="cn.xzx.test.TestAction"> 2 <result type="json"> 3 <param name="includeProperties">list</param> 4 </result> 5 </action>
结果:
解决方法:
{"list":[]}
解决方法:
1. User一定要实现
Serializable 接口
2. Action类中要求对应的getter方法
3. 配置文件修改为:
<result type="json"> <param name="includeProperties"> list.* </param> </result>