前后交互中传值问题的思考:当时用参数必填注解时 @RequestParam(required = true),Spring先行一步拦截的请求,自己业务上的提示无法响应给前端,注解本身不错,结合业务还是自行判断
@ResponseBody
public List<SysMenuDto> getListByParentId(HttpServletRequest request, @RequestParam(required = true) String parentMenuId) throws Exception {
//parentMenuId重点参数,希望给前端一个明确的提示
}
@RequestParam(required = false) String parentMenuId required默认为true org.springframework.web.bind.MissingServletRequestParameterException: Required String parameter 'parentMenuId' is not present