50,527
社区成员
发帖
与我相关
我的任务
分享
public String execute() throws Exception {
Map session = ActionContext.getContext().getSession();
SessionContainer container = (SessionContainer) session.get("container");
if(container.getAdmin().getAdminName() != null && container.getAdmin().getAdminName().equals("admin")) {
if(adminService.findByName(admin.getAdminName()) == null) {
admin.setPassword(MD5Util.encrypt(admin.getPassword())); //MD5加密密码
adminService.save(admin);
return SUCCESS;
} else { //用户名已存在
addActionError("用户名已存在");
return LOGIN;
}
}
return SUCCESS;
}
Map session = ActionContext.getContext().getSession();
SessionContainer container = (SessionContainer) session.get("container");
看不懂