|
没跳转任何页面,请问是什么原因?
Controller代码:
@RequestMapping(params = "saveOrg")
public ModelAndView saveOrg(OrganinfoEntity organinfo,HttpServletRequest req,TSUser user) throws ParseException {
Date date=new Date();
SimpleDateFormat sim=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date2 = (Date) sim.parseObject(sim.format(date));
String code=organinfo.getAddressCode()+organinfo.getOrgNo();
organinfo.setOrgNo(code);
organinfo.setOrgAddress(req.getParameter("orgAddress2")+organinfo.getOrgAddress());
organinfo.setOrgDate(date2);
TSDepart tSDepart= userService.getEntity(TSDepart.class, "402881ea424b9a5d01424b9b6aa50017");
userService.save(organinfo);
String message1 = "注册成功";
req.setAttribute("message1", message1);
return new ModelAndView("login/success");
}
JSP:代码
<html>
<head>
<script type="text/javascript" src="plug-in/jquery/jquery-1.8.3.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
var browserversion = "";
//IE8+浏览器
if ($.browser.msie) {
browserversion = "IE" + $.browser.version;
}
//谷歌浏览器
if ($.browser.webkit) {
browserversion = "Chrome" + $.browser.version;
}
//火狐浏览器
if ($.browser.mozilla) {
browserversion = "Mozilla Firefox" + $.browser.version;
}
//欧朋浏览器
if ($.browser.opera) {
browserversion = "Opera" + $.browser.version;
}
alert("注册成功!");
window.location.href = "loginController.do?login";
});
</script>
</head>
<body>
</body>
</html>
|
|