本文测试和探讨SpringMVC能够接收哪些类型的数据(非json数据) 准备工作 1,测试用Controller @Controller public class SpringTest { @RequestMapping("myTest") public void springMVCTest(int a){ } @RequestMapping("/") public String home(){ return "home.html"; } } 2,测试用页面 <!DOCTYPE html> <html lang="en"> <head> <title>这是测试页面</title> <meta charset="utf-8"> </head> <body> <button onclick="doAjax()">测试按钮</button> </body> <script src="js/jquery-3.3.1.min.js"></script> <script type="text/javascript"> function doAjax() { $.ajax({ url:"/myTest", type:"post", dataType:"json", async:true, data:{ }, }); } </script> </html> 开始测试 1,基本数据类型,包装类以及其数组 function doAjax() {