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") ...
随机推荐
- idea git tag 管理
项目release 之后一般都会打一个tag 做记录.本人使用idea管理tag的时候,遇到的问题做一些记录. 1:idea 创建tag idea 创建tag ,我们可以右键项目,然后按照下图操作创建 ...
- APUE学习笔记——10.18 system函数 与waitpid
system函数 system函数用方便在一个进程中执行命令行(一行shell命令). 用法如下: #include <stdio.h> #include <stdlib.h> ...
- RHCS高可用集群配置(luci+ricci+fence)
一.什么是RHCS RHCS是Red Hat Cluster Suite的缩写,也就是红帽集群套件,RHCS是一个能够提供高可用性.高可靠性.负载均衡.存储共享且经济廉价的集群工具集合,它将集群 ...
- LINUX中的DNS服务---高速缓存DNS
一.什么是DNS Domain Name System,域名系统. 万维网上作为域名和IP地址相互映射的一个分布式数据库,能够使用户更方便的访问互联网.他主要负责把域名和IP的相互转换 ...
- [Python] 跳过前几行快速读取文件内容:islice
from itertools import islice start = 1 # 跳过第一行idx=0,从idx=1开始读取文件 with codecs.open('data.json', encod ...
- Qt 5.8 移植编译、测试
/****************************************************************************** * Qt 5.8 移植编译.测试 * 说 ...
- WEB服务器都在做哪些工作?
作为WEB开发人员,我们肯定应该要知道WEB服务器都在做哪些工作,这里简单列举一下,有时间然后详细说明. (1)建立连接——接受一个客户端连接. (2)接收请求——从网络中读取一条 HTTP 请求报文 ...
- [译]缓解BEAST对TLS攻击的方式
原文链接:https://community.qualys.com/blogs/securitylabs/2011/10/17/mitigating-the-beast-attack-on-tls 原 ...
- (转载)从MVC到前后端分离
摘要:MVC模式早在上个世纪70年代就诞生了,直到今天它依然存在,可见生命力相当之强.MVC模式最早用于Smalltalk语言中,最后在其它许多开发语言中都得到了很好的应用,例如,Java中的Stru ...
- hive表数据导出到csv乱码原因及解决方案
转载自http://blog.csdn.net/lgdlxc/article/details/42126225 Hive表中的数据使用hive - e"select * from table ...