Controller的方法不要使用原子类型

    public AjaxResult consigneeQuery(long sellerId,int pageNum,int pageSize) {

SEVERE: Servlet.service() for servlet [enterprise] in context with path [] threw exception [Request processing failed; nested except
ion is java.lang.IllegalStateException: Optional long parameter 'sellerId' is present but cannot be translated into a null value due
 to being declared as a primitive type. Consider declaring it as object wrapper for the corresponding primitive type.] with root cau
se

===================

使用原子类型的问题

1  前台不传值时会报错

2  原子类型有默认值,不适合区别NULL场景

猜你喜欢

转载自curious.iteye.com/blog/2296155