Optional int parameter ‘productId‘ is present but cannot be translated into a null value

    @RequestMapping("/selectProductEdition")
    public TmyResultSet selectProductEdition(int productId){
    
    
        TmyResultSet tmyResultSet = editionService.selectProductEdition(productId);
        return tmyResultSet;
    }
```代码如上:
当前端不传值时,会默认     productId==null     
 但是int类型  不传值时默认为零 
 解决方法用  integer  进行接收   

猜你喜欢

转载自blog.csdn.net/bryangp/article/details/112920579