错误信息:Required request parameter 'XXX' for method parameter type String is not present 这种都是前端请求方式不同,后端处理方式不同 可以设置一下dataType 一定要注意 @ResponseBody 的使用 最终在一个博主评论下面看见了解决答案: 还有一个致命的一点,@ResponseBody本身不强制内容,返回的就是文本.如果方法体返回的是对象,大概率会调用这个对象的toString(),可以是重写也可以继承…
1.异常 org.springframework.http.converter.HttpMessageNotReadableException: Required request body is missing 情况一. 2.问题展示 @RequestMapping(value = "/somewhere", method = POST) public SomeResponse someHandler(@RequestBody XXXDTO xxxDTO) { ... } 当入参DTO…
Java新手,困扰了一下午. 发布时总是报这样一个错误. org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'XXX': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanNotOfRequiredTypeException…
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 2019-07-16 14:55:18.498 ERROR 8880 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter : *************************** APPLICATION FAILED T…
@RequestParam jQuery调用方式: deleteFile: function(filePath) { return ajax({ method: 'POST', url: '/cm/soft/package/package/deleteFile', data: { fileDir: filePath } }); }, 后台java controller形式 public BaseResultVO deleteFile(@RequestParam("fileDir") S…
Parameter 0 of method orderSqlSessionFactory in com.config.MultipleDBConfig required a single bean, but 2 were found: - orderDataSource: defined by method 'orderDataSource' in class path resource [com/config/MultipleDBConfig.class] - crmDataSource: d…
required string parameter 'XXX'is not present 的几种情况 情况一:原因是由于头文件类型不对,可以在MediaType中选择合适的类型,例如GET和POST 情况二:jquery提交delete时,不支持@RequestParam,只支持@PathVariable形式 情况三:若api在调用的时候,如果存在重类型,但不重名:例如:/id与/name,两者在类型上是一样的 情况四:这里提示Required String parameter 'XXX' i…
报错:required string parameter XXX is not present 不同工具发起的get/delete请求,大多数不支持@RequestParam,只支持@PathVariable形式 若api在调用的时候,如果存在重类型,但不重名:例如:/id与/name,两者在类型上是一样…
https://jira.spring.io/browse/SPR-12888 Description When I use @RequestBody on one of my controllers for a required parameter, I need some useful way of saying which parameter was missing if it's not there. The exception message I see currently looks…
遇到一个问题 在一个地址链接(URL)里使用 url?param1=val1&param2=val2 的方式传递参数,结果在获取参数值时发现不是当初设定的值. 具体案例 以特殊字符井号(#)为例. 部分参数值丢了 JS里设置参数 window.location="some_web_project/xxx.jsp?param_key=abc#xyz"; Java中取参数值 Sting paramVal = request.getParameter("param_key&…