problem description
ajaxSubmit submission of jQuery.form.js 400 error
the environmental background of the problems and what methods you have tried
ssm+suiMobile
Registration method is valid, update method is invalid
discard asynchronous submission (inappropriate)
related codes
/ / Please paste the code text below (do not replace the code with pictures)
/ *
*
* @param shop
* @param pictureFile
* @return
*/
@RequestMapping(value="/modifyshop")
@ResponseBody
public Map<String,Object> modifyShop(HttpServletRequest request,Shop shop,MultipartFile pictureFile,String captcha){
Map<String,Object> map = new HashMap<>();
if(!CodeUtil.checkVerifyCode(request, captcha)) {
map.put("success", false);
map.put("msg", "");
return map;
}
ShopExecution addShop = shopService.modifyShop(shop, pictureFile);
if(addShop.getState() == ShopStateEnum.CHECK.getState()) {
map.put("success", true);//
}else {
map.put("success", false);
map.put("msg", addShop.getStateInfo());
}
return map;
}
/**
*
* @param shop
* @param pictureFile
* @return
*/
@RequestMapping(value="/registershop",method=RequestMethod.POST)
@ResponseBody
public Map<String,Object> registerShop(HttpServletRequest request,Shop shop,MultipartFile pictureFile,String captcha){
Map<String,Object> map = new HashMap<>();
if(!CodeUtil.checkVerifyCode(request, captcha)) {
map.put("success", false);
map.put("msg", "");
return map;
}
ShopExecution addShop = shopService.addShop(shop, pictureFile);
if(addShop.getState() == ShopStateEnum.CHECK.getState()) {
map.put("success", true);//
}else {
map.put("success", false);
map.put("msg", addShop.getStateInfo());
}
return map;
}
var modifyShopUrl ="/ o _ 2o _
$("- sharpsubmitBtn") .click (function () {
var verifyCodeActual = $("-sharpj_captcha").val();
if (!verifyCodeActual) {
alert("");
return;
}
if(isEdit){
$("-sharpregisterForm").ajaxSubmit({
url: modifyShopUrl,
type: "post",
data:{shopId:_shopId},
success: function (data) {
if (data.success) {
alert("");
/*$.toast("");*/
} else {
/*$.toast("");*/
alert("");
}
$("-sharpcaptcha_img").click();
}
});
}else{
$("-sharpregisterForm").ajaxSubmit({
url: registerUrl,
type: "post",
success: function (data) {
if (data.success) {
alert("");
/*$.toast("");*/
} else {
/*$.toast("");*/
alert("");
}
$("-sharpcaptcha_img").click();
}
});
}
what result do you expect? What is the error message actually seen?
400 Bad Request