@[TOC](SpringMVC参数类型异常处理,Servlet.service() for servlet [springmvc] in context with path [/SpringMVC] threw exception [Request processing failed; nested exception is java.lang.IllegalStateException: Optional int parameter ‘password’ 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 cause
java.lang.IllegalStateException: Optional int parameter ‘password’ 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.)
图片:
将int类型改成包装类型即可,int - Integer
参考链接: 简书.