由于我提交的页面是问卷调查,提交name都不同,我想把前台的提交的form表单数据title=%E4%BB%8A%E5%A4%A9%E5%90%83%E5%8D%88%E9%A4%90&content1=%E5%8D%88%E9%A4%90%E5%8D%88%E9%A4%90&xx1=3&25=1&25=2&25=3&30=3&33=1
这种数据,拿到后台自己解析,请问 后台怎么能拿到这个数据
17 回复
@At
@Ok("json")
/*@SLog(tag = "添加模板", msg = "文章标题:${args[0].title}")*/
@AdaptBy(type = WhaleAdaptor.class)
public Object TijiaoWenjuan(@Param("..") String params, HttpServletRequest req) {
try {
System.out.println(params.toString());
return Result.success("system.success");
} catch (Exception e) {
return Result.error("system.error");
}
}
<form id="addForm" role="form" class="form-horizontal parsley-form" data-parsley-validate action="${base}/platform/cms/wenjuan/TijiaoWenjuan" method="post">
把 @AdaptBy 去掉试试
public Object TijiaoWenjuan(@Param("..")NutMap map, HttpServletRequest req) {
try {
for(String key:map.keySet()){
System.out.println("key= "+ key + " and value= " + map.get(key));
}
System.out.println(map.get("wj_id"));
System.out.println(map.toString());
return Result.success("system.success");
} catch (Exception e) {
return Result.error("system.error");
}
}
添加回复
请先登陆