form表单提交中文乱码问题,dwz ModelAndView跳转form中有中文参数乱码
method='get'中文参数会乱码,因为放在url后
method='post'中文不会乱码
dwz也有这种类似问题在使用ModelAndView进行跳转是没有定义type,此时会走GET,导致用ModelAndView跳转form中有中文参数乱码,在dwz的源码中:
dwz.min.js/dwz.core.js修改ajaxUrl 的$.ajax({ type: op.type || 'GET',为$.ajax({type: op.type || 'POST',
@RequestMapping(value="/account/tbCusFirmChg/saveNewUser",method = {RequestMethod.POST})
public ModelAndView saveNewUser(@RequestParam(value = "customerKey", required = false) String customerKey,
@RequestParam(value = "pz", required = false) String[] pz,
@RequestParam Map
regUser.put("MARKET_KEY", Integer.valueOf(1));
if(regUser.get("CUSTOMER_KEY")==null||"".equals(regUser.get("CUSTOMER_KEY"))){
regUser.put("CUS_TRADE_KIND", "B");
tbCusFirmChgService.saveNewUser(regUser, pz);
}else{
tbCusFirmChgService.updateUser(regUser, pz);
}
return ajaxDoneBasBed(200,"操作成功","/account/tbCusFirmChg/list");
//return ajaxDoneOpm("/commonuntil/ajaxDone",200,"操作成功!","tbCusFirmChgNav","/account/tbCusFirmChg/list","callbackType");
}
private ModelAndView ajaxDoneBasBed(int statusCode, String message, String forwardUrl) {
ModelAndView mav = new ModelAndView("/account/tbCusFirmChg/ajaxDone");
mav.addObject("statusCode", statusCode);
mav.addObject("message", message);
mav.addObject("type", "POST");
mav.addObject("navTabId", "tbCusFirmChgNav");
mav.addObject("callbackType", "closeCurrent");
mav.addObject("forwardUrl", forwardUrl);
return mav;//会再一次调用list自动提交form查询
}