方法不是最优解,需保证表单提交不能有空值
<form class="layui-form layui-form-pane" id="testForm" action="">
<input type="text" name="name"/>
<input type="text" name="name"/>
</form>
form.on('submit(postForm)', function (data) {
var formData = new FormData($("#testForm")[0]);
$.ajax({
url: "<c:url value='/test.do?action=test'/>",
type: 'post',
dataType: 'json',
});
});
@RequestMapping(params = "action=test")
public void test String[] name HttpServletResponse response) {
}