Resolved [org.springframework.web.bind.MissingServletRequestParameterException: Required request parameter ’email’ for method parameter type String is not present]

The send method of javamailsender reported an error local address contains illegal character in string

problem analysis

It was supposed to be a problem with the received parameters. As a result, the front end modified the format or reported an error

Finally, it is found that the parameter receiving method is wrong when printing the information in the controller

The email passed from the front end is a JSON object, similar to {“email”:“ [email protected] “}, and I use

@Requestparam (“email”) string is used to receive email. Naturally, an error is reported


Change the method of receiving parameters to @ requestbody Map & lt; String,Object> map

Use map. Get (“email”) to get the value

Similar Posts: