日期:2014-05-18 浏览次数:20789 次
@RequestMapping(value = "/update")
@ResponseBody
public String update(HttpServletRequest req, RulInfo rul)
throws IOException {
try {
if (!isEmpty(rul.getmName())) {
DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss ");
rul.setrTime(df.format(new Date()));
rul.setwUpdated("2");
rulService.update(rul);
map.put("success", true);
map.put("msg", "信息保存成功");
}
} catch (Exception e) {
map.put("success", false);
map.put("msg", "提示:" + e.getMessage());
e.printStackTrace();
}
return toJson(map);
}
if (checkUsrId) {
req.getRequestDispatcher("/index.jsp").forward(req, resp);
return null;
} else {
req.getSession().setAttribute("usrInfo", usr);
}
return "welcome";