ssm遇到的问题:Optional int parameter ‘id‘ is present but cannot be translated into a null value due to be

错误原因:

在springmvc接受参数的时候,使用基本数据类型接收了来自页面的id值。当后台获取页面数据时,id值可能为空,而int的默认值为0。但是来自页面的id值可能为null。

解决方案:Java后台获取页面数据的时候将nt换成integer即可解决。

猜你喜欢

转载自blog.csdn.net/weixin_47382783/article/details/118750822