NutzCN Logo
问答 如何把前端传过来的json字符串转换成List<Object>形式?
发布于 2557天前 作者 qq_36b64d67 1540 次浏览 复制 上一个帖子 下一个帖子
标签:

如题,如何把前端传过来的json字符串转换成List形式?

9 回复

表单?? 还是data?

data,要转换成对象的集合

@AdaptBy(type=JsonAdaptor.class)
public String someFunc(@Param("..")List<User> users){

parm里面不需要参数么?我前端是ajax传数据的data: JSON.stringify(data)data,data是一个数组

既然整个数据就是数组,那后端用List接收没有毛病

"!Json syntax error nearby [row:1,col:1 char 'd'], reason: 'Unexpect String = dbdataPojoList=%5B%7B%22id%22%3A10169%2C%22name%22%3A%22%E6%A0%A1%E5%86%85%E5%8D%95%E4%BD%8D%E7%A0%81%22%2C%22code%22%3A%2211110102%22%2C%22pid%22%3A1169%2C%22sort%22%3A0%2C%22notes%22%3A%22%22%2C%22addUserID%22%3A0%2C%22modifyUserID%22%3A0%2C%22isPublic%22%3Atrue%2C%22isDataTable%22%3Afalse%2C%22groupId%22%3A0%2C%22type%22%3A40%2C%22isRecordSort%22%3A0%2C%22groupSort%22%3A0%2C%22tooltip%22%3A%22%22%2C%22associationId%22%3A0%2C%22copyTableId%22%3A0%2C%22unitTable%22%3Afalse%2C%22froeigKey%22%3Afalse%2C%22enumId%22%3A0%2C%22fieldProperty%22%3A2%2C%22fieldLength%22%3A0%2C%22isFill%22%3A0%2C%22dataFieldType%22%3A0%2C%22isAge%22%3Afalse%2C%22ischecked%22%3Afalse%2C%22checked%22%3Afalse%2C%22fieldRelation%22%3A%22%22%2C%22isAssociationKey%22%3A0%2C%22regexExpression%22%3A%22%22%2C%22zzExpression%22%3A%22%22%2C%22glExpression%22%3A%22%22%2C%22onlyLeaf%22%3A0%2C%22isLockOut%22%3A0%2C%22associationSort%22%3A0%2C%22fieldType%22%3A0%2C%22requiredDataField%22%3A0%2C%22ParentDataFieldId%22%3A0%2C%22enumDependName%22%3A%22%E6%A0%A1%E5%86%85%E5%8D%95%E4%BD%8D%22%2C%22authority%22%3A0%2C%22expressionId%22%3A%22%22%2C%22titleId%22%3A0%2C%22reviewAllScore%22%3A0%2C%22reviewActualScore%22%3A0%2C%22reviewIsPass%22%3Afalse%2C%22isParent%22%3Afalse%2C%22chkDisabled%22%3Afalse%7D%2C%7B%22id%22%3A10169%2C%22name%22%3A%22%E7%A7%91%E5%AE%A4%E5%90%8D%E7%A7%B0%22%2C%22code%22%3A%2211110103%22%2C%22pid%22%3A1169%2C%22sort%22%3A0%2C%22notes%22%3A%22%22%2C%22addUserID%22%3A0%2C%22modifyUserID%22%3A0%2C%22isPublic%22%3Atrue%2C%22isDataTable%22%3Afalse%2C%22groupId%22%3A0%2C%22type%22%3A40%2C%22isRecordSort%22%3A0%2C%22groupSort%22%3A0%2C%22tooltip%22%3A%22%22%2C%22associationId%22%3A0%2C%22copyTableId%22%3A0%2C%22unitTable%22%3Afalse%2C%22froeigKey%22%3Afalse%2C%22enumId%22%3A0%2C%22fieldProperty%22%3A2%2C%22fieldLength%22%3A0%2C%22isFill%22%3A0%2C%22dataFieldType%22%3A0%2C%22isAge%22%3Afalse%2C%22ischecked%22%3Afalse%2C%22checked%22%3Afalse%2C%22fieldRelation%22%3A%22%22%2C%22isAssociationKey%22%3A0%2C%22regexExpression%22%3A%22%22%2C%22zzExpression%22%3A%22%22%2C%22glExpression%22%3A%22%22%2C%22onlyLeaf%22%3A0%2C%22isLockOut%22%3A0%2C%22associationSort%22%3A0%2C%22fieldType%22%3A0%2C%22requiredDataField%22%3A0%2C%22ParentDataFieldId%22%3A0%2C%22enumDependName%22%3A%22%E6%A0%A1%E5%86%85%E5%8D%95%E4%BD%8D%22%2C%22authority%22%3A0%2C%22expressionId%22%3A%22%22%2C%22titleId%22%3A0%2C%22reviewAllScore%22%3A0%2C%22reviewActualScore%22%3A0%2C%22reviewIsPass%22%3Afalse%2C%22isParent%22%3Afalse%2C%22chkDisabled%22%3Afalse%7D%2C%7B%22id%22%3A10169%2C%22name%22%3A%22%E4%BA%BA%E5%91%98%E7%B1%BB%E5%88%AB%E7%A0%81%22%2C%22code%22%3A%2211110105%22%2C%22pid%22%3A1169%2C%22sort%22%3A0%2C%22notes%22%3A%22%22%2C%22addUserID%22%3A0%2C%22modifyUserID%22%3A0%2C%22isPublic%22%3Atrue%2C%22isDataTable%22%3Afalse%2C%22groupId%22%3A0%2C%22type%22%3A40%2C%22isRecordSort%22%3A0%2C%22groupSort%22%3A0%2C%22tooltip%22%3A%22%22%2C%22associationId%22%3A0%2C%22copyTableId%22%3A0%2C%22unitTable%22%3Afalse%2C%22froeigKey%22%3Afalse%2C%22enumId%22%3A0%2C%22fieldProperty%22%3A2%2C%22fieldLength%22%3A0%2C%22isFill%22%3A0%2C%22dataFieldType%22%3A0%2C%22isAge%22%3Afalse%2C%22ischecked%22%3Afalse%2C%22checked%22%3Afalse%2C%22fieldRelation%22%3A%22%22%2C%22isAssociationKey%22%3A0%2C%22regexExpression%22%3A%22%22%2C%22zzExpression%22%3A%22%22%2C%22glExpression%22%3A%22%22%2C%22onlyLeaf%22%3A0%2C%22isLockOut%22%3A0%2C%22associationSort%22%3A0%2C%22fieldType%22%3A0%2C%22requiredDataField%22%3A0%2C%22ParentDataFieldId%22%3A0%2C%22enumDependName%22%3A%22%E4%BA%BA%E5%91%98%E7%B1%BB%E5%88%AB%22%2C%22authority%22%3A0%2C%22expressionId%22%3A%22%22%2C%22titleId%22%3A0%2C%22reviewAllScore%22%3A0%2C%22reviewActualScore%22%3A0%2C%22reviewIsPass%22%3Afalse%2C%22isParent%22%3Afalse%2C%22chkDisabled%22%3Afalse%7D%2C%7B%22id%22%3A10169%2C%22name%22%3A%22%E5%B2%97%E4%BD%8D%E7%8A%B6%E6%80%81%E7%A0%81%22%2C%22code%22%3A%2211110107%22%2C%22pid%22%3A1169%2C%22sort%22%3A0%2C%22notes%22%3A%22%22%2C%22addUserID%22%3A0%2C%22modifyUserID%22%3A0%2C%22isPublic%22%3Atrue%2C%22isDataTable%22%3Afalse%2C%22groupId%22%3A0%2C%22type%22%3A40%2C%22isRecordSort%22%3A0%2C%22groupSort%22%3A0%2C%22tooltip%22%3A%22%22%2C%22associationId%22%3A0%2C%22copyTableId%22%3A0%2C%22unitTable%22%3Afalse%2C%22froeigKey%22%3Afalse%2C%22enumId%22%3A0%2C%22fieldProperty%22%3A2%2C%22fieldLength%22%3A0%2C%22isFill%22%3A0%2C%22dataFieldType%22%3A0%2C%22isAge%22%3Afalse%2C%22ischecked%22%3Afalse%2C%22checked%22%3Afalse%2C%22fieldRelation%22%3A%22%22%2C%22isAssociationKey%22%3A0%2C%22regexExpression%22%3A%22%22%2C%22zzExpression%22%3A%22%22%2C%22glExpression%22%3A%22%22%2C%22onlyLeaf%22%3A0%2C%22isLockOut%22%3A0%2C%22associationSort%22%3A0%2C%22fieldType%22%3A0%2C%22requiredDataField%22%3A0%2C%22ParentDataFieldId%22%3A0%2C%22enumDependName%22%3A%22%E5%B2%97%E4%BD%8D%E7%8A%B6%E6%80%81%22%2C%22authority%22%3A0%2C%22expressionId%22%3A%22%22%2C%22titleId%22%3A0%2C%22r…11110140%22%2C%22pid%22%3A1169%2C%22sort%22%3A0%2C%22notes%22%3A%22%22%2C%22addUserID%22%3A0%2C%22modifyUserID%22%3A0%2C%22isPublic%22%3Atrue%2C%22isDataTable%22%3Afalse%2C%22groupId%22%3A0%2C%22type%22%3A30%2C%22isRecordSort%22%3A0%2C%22groupSort%22%3A0%2C%22tooltip%22%3A%22%22%2C%22associationId%22%3A0%2C%22copyTableId%22%3A0%2C%22unitTable%22%3Afalse%2C%22froeigKey%22%3Afalse%2C%22enumId%22%3A0%2C%22fieldProperty%22%3A1%2C%22fieldLength%22%3A0%2C%22isFill%22%3A0%2C%22dataFieldType%22%3A0%2C%22isAge%22%3Afalse%2C%22ischecked%22%3Afalse%2C%22checked%22%3Afalse%2C%22fieldRelation%22%3A%22%22%2C%22isAssociationKey%22%3A0%2C%22regexExpression%22%3A%22TIMESTAMPDIFF(year%2C%7B0%7D%2Cnow())%2B1%22%2C%22zzExpression%22%3A%22%22%2C%22glExpression%22%3A%22%22%2C%22onlyLeaf%22%3A0%2C%22isLockOut%22%3A0%2C%22associationSort%22%3A0%2C%22fieldType%22%3A0%2C%22requiredDataField%22%3A0%2C%22ParentDataFieldId%22%3A0%2C%22enumDependName%22%3A%22%22%2C%22authority%22%3A0%2C%22expressionId%22%3A%22%22%2C%22titleId%22%3A0%2C%22reviewAllScore%22%3A0%2C%22reviewActualScore%22%3A0%2C%22reviewIsPass%22%3Afalse%2C%22isParent%22%3Afalse%2C%22chkDisabled%22%3Afalse%7D%2C%7B%22id%22%3A10169%2C%22name%22%3A%22%E5%B7%A5%E8%B5%84%E5%8F%B7%22%2C%22code%22%3A%2211110142%22%2C%22pid%22%3A1169%2C%22sort%22%3A0%2C%22notes%22%3A%22%22%2C%22addUserID%22%3A0%2C%22modifyUserID%22%3A0%2C%22isPublic%22%3Atrue%2C%22isDataTable%22%3Afalse%2C%22groupId%22%3A0%2C%22type%22%3A7%2C%22isRecordSort%22%3A0%2C%22groupSort%22%3A0%2C%22tooltip%22%3A%2211111%22%2C%22associationId%22%3A0%2C%22copyTableId%22%3A0%2C%22unitTable%22%3Afalse%2C%22froeigKey%22%3Afalse%2C%22enumId%22%3A0%2C%22fieldProperty%22%3A2%2C%22fieldLength%22%3A6%2C%22isFill%22%3A0%2C%22dataFieldType%22%3A0%2C%22isAge%22%3Afalse%2C%22ischecked%22%3Afalse%2C%22checked%22%3Afalse%2C%22fieldRelation%22%3A%22%22%2C%22isAssociationKey%22%3A0%2C%22regexExpression%22%3A%22%22%2C%22zzExpression%22%3A%22%22%2C%22glExpression%22%3A%22%22%2C%22onlyLeaf%22%3A0%2C%22isLockOut%22%3A0%2C%22associationSort%22%3A0%2C%22fieldType%22%3A0%2C%22requiredDataField%22%3A0%2C%22ParentDataFieldId%22%3A0%2C%22enumDependName%22%3A%22%22%2C%22authority%22%3A0%2C%22expressionId%22%3A%22%22%2C%22titleId%22%3A0%2C%22reviewAllScore%22%3A0%2C%22reviewActualScore%22%3A0%2C%22reviewIsPass%22%3Afalse%2C%22isParent%22%3Afalse%2C%22chkDisabled%22%3Afalse%7D%2C%7B%22id%22%3A10169%2C%22name%22%3A%224324%E6%88%90%E9%83%BD%E5%B8%82%22%2C%22code%22%3A%22%22%2C%22pid%22%3A1169%2C%22sort%22%3A0%2C%22notes%22%3A%22%E6%B5%8B%E8%AF%95%E4%BD%BF%E7%94%A8%E7%9A%84%E5%AD%97%E6%AE%B5%22%2C%22addUserID%22%3A0%2C%22modifyUserID%22%3A0%2C%22isPublic%22%3Atrue%2C%22isDataTable%22%3Afalse%2C%22groupId%22%3A0%2C%22type%22%3A7%2C%22isRecordSort%22%3A0%2C%22groupSort%22%3A0%2C%22tooltip%22%3A%22%E5%95%A6%E5%95%A6%E5%95%A6%E5%98%BB%E5%98%BB%E5%98%BB%22%2C%22associationId%22%3A0%2C%22copyTableId%22%3A0%2C%22unitTable%22%3Afalse%2C%22froeigKey%22%3Afalse%2C%22enumId%22%3A0%2C%22fieldProperty%22%3A2%2C%22fieldLength%22%3A250%2C%22isFill%22%3A0%2C%22dataFieldType%22%3A0%2C%22isAge%22%3Afalse%2C%22ischecked%22%3Afalse%2C%22checked%22%3Afalse%2C%22fieldRelation%22%3A%22%22%2C%22isAssociationKey%22%3A0%2C%22regexExpression%22%3A%22%2C%22%2C%22zzExpression%22%3A%22%22%2C%22glExpression%22%3A%22%22%2C%22onlyLeaf%22%3A0%2C%22isLockOut%22%3A0%2C%22associationSort%22%3A0%2C%22fieldType%22%3A0%2C%22requiredDataField%22%3A1%2C%22ParentDataFieldId%22%3A0%2C%22enumDependName%22%3A%22%22%2C%22authority%22%3A0%2C%22expressionId%22%3A%22%22%2C%22titleId%22%3A0%2C%22reviewAllScore%22%3A0%2C%22reviewActualScore%22%3A0%2C%22reviewIsPass%22%3Afalse%2C%22isParent%22%3Afalse%2C%22chkDisabled%22%3Afalse%7D%2C%7B%22id%22%3A10169%2C%22name%22%3A%22%E5%B8%83%E5%B0%94%E6%B5%8B%E8%AF%95%E5%8F%91v%E5%8F%91%E7%9A%84%22%2C%22code%22%3A%22%22%2C%22pid%22%3A1169%2C%22sort%22%3A0%2C%22notes%22%3A%22%E5%8F%91v%E7%9A%84%E6%92%92%E5%8F%91%E9%80%81%E5%8F%91%22%2C%22addUserID%22%3A0%2C%22modifyUserID%22%3A0%2C%22isPublic%22%3Atrue%2C%22isDataTable%22%3Afalse%2C%22groupId%22%3A0%2C%22type%22%3A21%2C%22isRecordSort%22%3A0%2C%22groupSort%22%3A0%2C%22tooltip%22%3A%22%22%2C%22associationId%22%3A0%2C%22copyTableId%22%3A0%2C%22unitTable%22%3Afalse%2C%22froeigKey%22%3Afalse%2C%22enumId%22%3A0%2C%22fieldProperty%22%3A2%2C%22fieldLength%22%3A0%2C%22isFill%22%3A0%2C%22dataFieldType%22%3A0%2C%22isAge%22%3Afalse%2C%22ischecked%22%3Afalse%2C%22checked%22%3Afalse%2C%22fieldRelation%22%3A%22%22%2C%22isAssociationKey%22%3A0%2C%22regexExpression%22%3A%22%2C%22%2C%22zzExpression%22%3A%22%22%2C%22glExpression%22%3A%22%22%2C%22onlyLeaf%22%3A0%2C%22isLockOut%22%3A0%2C%22associationSort%22%3A0%2C%22fieldType%22%3A0%2C%22requiredDataField%22%3A0%2C%22ParentDataFieldId%22%3A0%2C%22enumDependName%22%3A%22%22%2C%22authority%22%3A0%2C%22expressionId%22%3A%22%22%2C%22titleId%22%3A0%2C%22reviewAllScore%22%3A0%2C%22reviewActualScore%22%3A0%2C%22reviewIsPass%22%3Afalse%2C%22isParent%22%3Afalse%2C%22chkDisabled%22%3Afalse%7D%5D'"

这是什么情况?

js端没有发json,发了表单

OK.好了,谢谢

添加回复
请先登陆
回到顶部