Required String parameter 'id' is not present
问题详情:
简单的说,我就是通过ajax发起了一个post请求到后台,但是后台没有收到请求发过去的参数,并且还报了这样的错误。
错误描述告诉我们,请求参数里面并没有存在id。我检查的浏览器的请求,确实有带参数,拼写无误。
那么,必然就是接收方式出错了,参数错误或者是post请求不能这么接收。
前端页面,发起Ajax请求,请求方式为post。
$.ajax({
url: "test/test",
type:"POST"
data:'{"id":"1111","date":"2018"}',
success: function(){
.....
}});
后端代码,接收方式为@ PostMap("/test"),@RequestParam
@GetMapping("/test")
@RequiresPermissions({"test"})
@ResponseBody
public TableDataInfo test(@RequestParam String id,@RequestParam String date)
{
......
}
解决方案:
1、将后台代码的 @RequestParam 改为@RequestBody
测试后发现有问题,报错。
2、干脆不用post请求,改为get,亲测有效。
Required String parameter 'id' is not present的更多相关文章
- 后台接收参数报错 Required String parameter 'id' is not present
来自:https://blog.csdn.net/qq_15238647/article/details/81539287 关于ajax请求spring后台出现 Required String par ...
- required string parameter XXX is not present
@RequestParam jQuery调用方式: deleteFile: function(filePath) { return ajax({ method: 'POST', url: '/cm/s ...
- required string parameter 'XXX'is not present 的几种情况
required string parameter 'XXX'is not present 的几种情况 情况一:原因是由于头文件类型不对,可以在MediaType中选择合适的类型,例如GET和POST ...
- 报错:required string parameter XXX is not present
报错:required string parameter XXX is not present 不同工具发起的get/delete请求,大多数不支持@RequestParam,只支持@PathVari ...
- HTTP Status 400 - Required String parameter 'userName' is not present 错误
HTTP Status 400 - Required String parameter 'userName' is not present 错误 先mark 有时间详细写 参考链接: https:/ ...
- Jpa 报错 :HTTP Status 400 - Required String parameter 'xx' is not present
一.问题描述 使用Springboot JPA 做分页查询,报错Required String parameter 'xx' is not present,后端未接受到请求 二.解决方案: 使用的请求 ...
- 400错误,Required String parameter 'paramter' is not present
1.就拿简单的登录来说吧,这是开始的代码 @RequestMapping(value="/login")public ModelAndView login(@RequestPara ...
- org.springframework.web.bind.MissingServletRequestParameterException: Required String parameter 'xxxx' is not present
org.springframework.web.bind.MissingServletRequestParameterException: Required String parameter 'xxx ...
- Required String parameter 'images' is not present
后台控制层控制为非必填即可: @RequestMapping("/addDo") @SJson @SLog(description = "Car_main") ...
随机推荐
- Python基本常用算法
什么是算法 就是一个计算的过程,解决问题的方法 用到知识点 递归 调用自身 有结束条件 下次执行相应的复杂度要减少 时间复杂度排序(按效率排序) O(1)<O(logn)<O(n)< ...
- a的样式
.myAucCItem a { color: rgb(71,71,71);} .myAucCItem a:hover { color: rgb(71,71,71); text-decoration: ...
- defer async 区别
链接 <script src="script.js"></script> 没有 defer 或 async,浏览器会立即加载并执行指定的脚本,“立即”指的是 ...
- css移动元素的几种方法
一.当然是元素设定为postion: absolute, 然后控制 left, top 位置 二.元素增加overflow属性,然后设置元素的scrollLeft, scrollRight当做滚动条来 ...
- (转)MapReduce Design Patterns(chapter 6 (part 1))(十一)
Chapter 6. Metapatterns 这种模式不是解决某个问题的,而是处理模式的关系的.可以理解为“模式的模式”.首先讨论的是job链,把几个模式联合起来解决复杂的,有多个阶段要处理的问题. ...
- webpy/flask/bottle性能测试
这三个都是Python WSGI的web开发框架,到底用哪个呢?单纯从性能的角度而言,可能哪个快就用哪个,但是这也不是绝对的.比如我就比较喜欢webpy的router配置放在一个文件中,而flask和 ...
- 高德地图Demo运行报错 com.android.ide.common.process.ProcessException: Failed to execute aapt
最近由于有需求去做导航方面的Android开发,很是无奈,以前也的确是没有搞过,领导开大会当着所有人的面说这是给我分配的第一个工作,无论如何要做好,突然间感觉压力好大,自己已经多年没有敲过代码,而且A ...
- ubuntu 终端命令颜色的修改
http://blog.chinaunix.net/uid-13954789-id-3137184.html http://blog.chinaunix.net/uid-26021340-id-348 ...
- ZOJ3329One Person Game(循环型 数学期望)
There is a very simple and interesting one-person game. You have 3 dice, namely Die1, Die2 and Die3. ...
- 解决 mklink 使用中的各种坑(硬链接,软链接/符号链接,目录链接)
通过 mklink 命令可以创建文件或文件夹的链接,而这种链接跟快捷方式是不一样的.然而我们还可能会遇到其使用过程中的一些坑,本文将整理这些坑并提供解决方法. 0x00 背景介绍:mklink m ...