javaBena中的boolean类型的isName字段,
1 如果使用通用mapper的查数据库,控制台可以看到字段的false|ture
,返回前端如果使用ResponseBody|ResponseEntity
则可能存在前端获取的json缺少该字段。为什么是可能,因为我刚开始运行好几次没问题,用着用着就出现前端没有该字段,原因未知。如果使用Jackson序列化或者字符串就没有在这个问题
2 如果使用mybatis的注解或xml查询,前端能得到该字段,但是字段会缺少is,变为name,
3 如果不查数据库,单定义包含这种字段的对象,浏览器可以正常获取,也不缺少不少is
建议:功底不足,少使用isName这种方式,容易采坑
如果非要使用,可以参考https://blog.csdn.net/u011646880/article/details/79159533