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)
本文深入解析了@RequestParam注解的使用方法及其在Web请求中的作用,强调了如何通过设置required属性来控制参数的必要性,为开发者提供了在Servlet环境中正确使用此注解的指导。
1349

被折叠的 条评论
为什么被折叠?



