【发布时间】:2026-02-17 06:20:03
【问题描述】:
我的控制器接受参数
public
void changeAvatar(
@ApiParam(value = "A new avatar for the user", required = true)
@RequestPart final MultipartFile avatar,
BindingResult bindingResult
)
当向控制器发送请求时,他把我扔出去
java.lang.IllegalStateException: An Errors/BindingResult argument is expected to be declared immediately after the model attribute, the @RequestBody or the @RequestPart arguments to which they apply: public void com.web.web.controller.SettingsRestController.changeAvatar(org.springframework.web.multipart.MultipartFile,org.springframework.validation.BindingResult) throws java.io.IOException
【问题讨论】:
标签: java spring spring-mvc spring-boot