Can java @ Vaild be used for annotation verification on objects?

public String save (@ RequestBody @ Valid Stad stad)
there is no problem when there is only an object. Now, when saving the object, there is still a file to upload at the same time.
because the object encapsulates json in the data, can I convert the json to an object and verify it again?

public String save(
            @RequestParam("file")MultipartFile file,
            @Valid Stad stad,
            @Valid @NotNull String name
    )
Mar.19,2021

directly

public String save(
            @RequestParam("file")MultipartFile file@Valid Stad stad,BindingResult result
    )

can be checked, form submission or ajax upload can be done without json conversion.

Menu