我需要从jQuery属性模型中获取数据,但是在控制台中,我遇到了一个错误ERR_INCOMPLETE_CHUNKED_ENCODING
。
Spring控制台错误日志:
com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields (BeanSerializerBase.java:719) ~ [jackson-databind-2.9.6.jar: 2.9.6]
at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize (BeanSerializer.java:155) ~ [jackson-databind-2.9.6.jar: 2.9.6]
at com.fasterxml.jackson.databind.ser.std.CollectionSerializer.serializeContents (CollectionSerializer.java:145) ~ [jackson-databind-2.9.6.jar: 2.9.6]
at com.fasterxml.jackson.databind.ser.std.CollectionSerializer.serialize (CollectionSerializer.java:107) ~ [jackson-databind-2.9.6.jar: 2.9.6]
at com.fasterxml.jackson.databind.ser.std.CollectionSerializer.serialize (CollectionSerializer.java:25) ~ [jackson-databind-2.9.6.jar: 2.9.6]
at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField (BeanPropertyWriter.java:727) ~ [jackson-databind-2.9.6.jar: 2.9.6]
at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields (BeanSerializerBase.java:719) ~ [jackson-databind-2.9.6.jar: 2.9.6]
at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize (BeanSerializer.java:155) ~ [jackson-databind-2.9.6.jar: 2.9.6]
at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField (BeanPropertyWriter.java:727) ~ [jackson-databind-2.9.6.jar: 2.9.6]
at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields (BeanSerializerBase.java:719) ~ [jackson-databind-2.9.6.jar: 2.9.6]
at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize (BeanSerializer.java:155) ~ [jackson-databind-2.9.6.jar: 2.9.6]
控制器
List<Species> species = speciesRepository.findAll();
model.addAttribute("species", species);
JavaScript
<script type="text/javascript" th:inline="javascript">
/*<![CDATA[*/
var species = /*[[${species}]]*/ ;
/*]]>*/
console.log(species);
也许有人可以帮助解决这个问题