Ssm 中用RedirectAttributes做提示消息`
@RequiresPermissions("hic:zybl:hicZybl:edit")
@RequestMapping(value = "save")
public String save(HicZybl hicZybl, Model model, RedirectAttributes redirectAttributes) {
hicZyblService.save(hicZybl);
addMessage(redirectAttributes, "保存成功");
return "redirect:" + Global.getAdminPath() + "/hic/zybl/hicZybl/?repage";
}
protected void addMessage(RedirectAttributes redirectAttributes, String... messages) {
StringBuilder sb = new StringBuilder();
for (String message : messages) {
sb.append(message).append(messages.length > 1 ? "<br/>" : "");
}
redirectAttributes.addFlashAttribute("message", sb.toString());
}
保存成功返回之前的页面,在js页面获取
if(!isEmpty('${message}')){
layer.msg('${message}')
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)