为什么传给前台的itemVO获取值全部是null
itemModel得到值了,没有传递过去。
后台报错,数据库插入成功,前台报错 错误信息为:添加失败,错误为 >然后就没了
2019-02-21 09:24:28.589 INFO 8496 --- [nio-8090-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring FrameworkServlet 'dispatcherServlet' 2019-02-21 09:24:28.589 INFO 8496 --- [nio-8090-exec-1] o.s.web.servlet.DispatcherServlet : FrameworkServlet 'dispatcherServlet': initialization started 2019-02-21 09:24:28.613 INFO 8496 --- [nio-8090-exec-1] o.s.web.servlet.DispatcherServlet : FrameworkServlet 'dispatcherServlet': initialization completed in 24 ms 2019-02-21 09:24:36.065 INFO 8496 --- [nio-8090-exec-1] com.alibaba.druid.pool.DruidDataSource : {dataSource-1} inited 2019-02-21 09:25:25.298 WARN 8496 --- [nio-8090-exec-1] .m.m.a.ExceptionHandlerExceptionResolver : Resolved [org.springframework.http.converter.HttpMessageConversionException: Type definition error: [simple type, class com.miaoshaproject.controller.viewobject.ItemVO]; nested exception is com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class com.miaoshaproject.controller.viewobject.ItemVO and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: com.miaoshaproject.response.CommonReturnType["data"])]
老师的视频里面也没set get方法,但是就没报错,不知道为啥。
我也是因为这个错找了半天
知道了,原来是我的itemVO没有 set and get 方法 解决了