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") ...
随机推荐
- 【前端安全】 web前端安全编码(模版篇)【转】
在web的开发的开发过程中,前端总是在处理后端打的各种变量,变量可以包含着中的各种各样的字符,如果不对这些字符进行”特殊“处理的话,轻者导 致页面不正常的显示,潜入了其他的东西,亦即页面挂了,或者弹出 ...
- Java基础学习-包装类
package packaging; /*包装类: 是封装了基本数据类型的类,为了提供更多复杂方法 Integer: String---int 1.intvalue() 2.parseTnt() in ...
- 根据显示器的分辨率,加载不同CSS样式表
<link rel="stylesheet" type="text/css" id="css"><script langu ...
- linux uname和dpkg命令
uname -a:查看系统一些参数 dpkg -i:安装下载好的.deb包裹
- 在IIS上搭建FTP站点
操作环境 系统:win7 IIS版本:7.5 FTP传输工具:FlashXP 概述 本文介绍了如何在win7下利用IIS(默认已安装IIS和FTP功能)搭建FTP站点,FTP站点的常用配置. 快速搭建 ...
- BD09坐标(百度坐标) WGS84(GPS坐标) GCJ02(国测局坐标) 的相互转换
BD09坐标(百度坐标) WGS84(GPS坐标) GCJ02(国测局坐标) 的相互转换 http://www.cnphp6.com/archives/24822 by root ⋅ Leave a ...
- skywalking探针tomcat8.0.28报错解决
在部署skywalking agent的时候遇到一个异常 环境如下: tomcat8.0.28 catalina.out 日志报如下错误 30-Apr-2019 10:25:57.664 INFO [ ...
- BZOJ2131 免费的馅饼【线段树优化DP】
Input 第一行是用空格隔开的二个正整数,分别给出了舞台的宽度W(1到10^8之间)和馅饼的个数n(1到10^5). 接下来n行,每一行给出了一块馅饼的信息.由三个正整数组成,分别表示了每个馅饼落到 ...
- 集群搭建SSH的作用及这些命令的含义
authorized_keys文件 远程主机将用户的公钥,保存在登录后的用户主目录的$HOME/.ssh/authorized_keys文件中.公钥就是一段字符串,只要把它追加在authorized_ ...
- Mat代码操作
#include<opencv2/opencv.hpp> #include<iostream> using namespace std; using namespace cv; ...