看视频课的时候自己创建了一个数据库运行,报了500,检查了DAO、web.xml都没发现错误。
仔细阅读了报错信息👇 发现是Fruit类中的变量类型与数据库中的类型不一致
Description The server encountered an unexpected condition that prevented it from fulfilling the request.
Exception
java.lang.IllegalArgumentException: Can not set java.lang.Integer field com.pojo.Fruit.price to java.lang.Float
fruit类🡻:
数据库🡻:
改动任意一者,保持一致即可