postman里的报错
@RequestParam()用法:
绑定前端提交的参数,追进去看看源码:
* Annotation which indicates that a method parameter should be bound to a web * request parameter. Supported for annotated handler methods in Servlet and * Portlet environments.
这段英文的意思是这个注解表明需要方法参数绑定在web请求中,支持servlet中带注释的处理方法
所以,注解中加入required=false
@RequestParam(value = "username", required = false)