表单直接提交页面,不用ajax
后台;
/** * 修改 */ public void edit() { String id=getPara("id"); String job=getPara("job"); String username=getPara("username"); String nickName=getPara("nickName"); String phone=getPara("phone"); SysUser suser=SysUser.dao.findById(id).setJob(job).setUsername(username).setNickName(nickName). setPhone(phone); Boolean b=suser.update(); setAttr("msg",b); setAttr("user",suser); render("myself.html"); }
前台js:
var msg='#(msg)'; if(msg.length>0){ if(msg){ layer.msg("操作成功"); }else{ layer.msg("操作失败"); } }