原始页面
跳转后的页面
JSP
<script type="text/javascript"> function validateCallback(form, callback) { var $form = $(form); if (!$form.valid()) { return false; } var checked=false; var ids= document.getElementsByName("CVNUMBER"); for(var i=0;i<ids.length;i++){ if(ids[i].checked){ checked=true; } } if(!checked){ //请选择信息再进行保存操作 alertMsg.error('<spring:message code="hr.alert.message.viewPersonalInfo.checkBoxForChecked"/>'); return false; } var cvListnum= document.getElementById("cvList").value; for (i=0;i<goAbroadListnum;i++){ if(document.getElementById("CVNUMBER"+i).checked){ var sd=document.getElementById("CVPASS_"+i).value; var ed=document.getElementById("CVArchive_"+i).value; var date1 = sd.replaceAll("-",""); var date2 = ed.replaceAll("-",""); if (date1 - date2 > 0) { //alert("开始时间不能晚于结束时间"); alertMsg.error('<spring:message code="hr.alert.message.viewPersonalInfo.checkStartEndDate"/>'); document.getElementById("START_DATE_"+i).focus(); return false; } } } $.ajax({ type: form.method || 'POST', url:$form.attr("action"), data:$form.serializeArray(), dataType:"json", cache: false, success: DWZ.ajaxDone, error: DWZ.ajaxError }); return false; } </script> <div class="pageContent"> <form id="updateCVInfo" method="post" action="/hrm/empinfo/updateCVInfoTEST" class="pageForm required-validate" onsubmit="return validateCallback(this, dialogAjaxDone)">
Java Controller
@RequestMapping(value = "/updateCVInfoTEST") @ResponseBody public Map updateCVInfoTEST(HttpServletRequest request, HttpServletResponse response,ModelMap modelMap)throws Exception{ Map<String, Object> map = new HashMap<String, Object>(); int result = this.empInfoSer.updateCVInfo(request); //CICI if(result == 1){ map.put("statusCode", "200"); map.put("message", TipMessage.getTipMessage("alert.message.update_success",request));//修改成功 map.put("navTabId", "hr0101"); // map.put("navTabId", "hr0115"); map.put("callbackType", "closeCurrent"); map.put("forwardUrl","/hrm/empinfo/viewPersonalInfo?PERSON_ID=" + request.getParameter("PERSON_ID")+"&navTabId=hr0101") ; }else{ map.put("statusCode", "300"); map.put("message", TipMessage.getTipMessage("alert.message.update_fail",request));//修改失败 map.put("navTabId", "hr0101"); map.put("forwardUrl","/hrm/empinfo/viewPersonalInfo?PERSON_ID=" + request.getParameter("PERSON_ID")+"&navTabId=hr0101") ; } return map; }