我想讲前台的参数转换成为List对象,我的代码如下:
方法声明
@Ok("forward:/scene/showScenePage")
@At("/dealCollisionAttackScene")
@AdaptBy(type=JsonAdaptor.class)
public void dealCollisionAttackScene(HttpServletRequest request, Ioc ioc, @Param("::infoList")
List<CollisionAttackSceneInfo> infoList,)
public class CollisionAttackSceneInfo {
private String businessSystemName;
private Integer intervalMinute;// 间隔时间
private Integer frequency;// 频次
//忽略get,set
那么前台表单的参数应该如何定义呢?我这样试过,但是仍然不行
var data = {infoList:
[
{
businessSystemName:'bugzilla',
intervalMinute:5,
frequency:400
},
{
businessSystemName:'bugzilla',
intervalMinute:5,
frequency:400
}
]
};
$.ajax({
type: "POST",
url: "<c:url value='/scene/dealCollisionAttackScene?sceneType=${sceneType}'/>",
data: data,
success: function(msg){
alert( "Data Saved: " + msg );
}
});
}
但是直接报错,请问我前台的参数应该这样传递后台才能解析成为List对象或者CollisionAttackSceneInfo[]对象