public void doEdit( @FormGroup("editUserInfo") Group userInfo, @Param("pageIndex") int pageIndex, @Param("searchKey") String searchKey, Navigator nav, @FormField(name = "formUserError", group = "editUserInfo") CustomErrors err) { User user = new User(); userInfo.setProperties(user); if (null != user.getPassword()) { if (user.getPassword().length() < 6) { err.setMessage("passwordTooLess"); return; } user.setPassword(SecurityUtils.getPassword(user.getPassword())); } try { userService.updataUser(user); } catch (RepeatConfigureException rce) { err.setMessage("invalidUser"); return; } nav.redirectToLocation( "userManager.htm?pageIndex=" + pageIndex + "&searchKey=" + urlEncode(searchKey)); }
/** 修改系统参数 */ public void doEdit( @FormGroup("systemParameterDetailInfo") Group systemParameterDetailInfo, Navigator nav) throws Exception { SystemParameter systemParameter = new SystemParameter(); systemParameterDetailInfo.setProperties(systemParameter); systemParameterService.createOrUpdate(systemParameter); nav.redirectToLocation("systemParameter.htm?"); }
public void doAdd( @FormGroup("addUserInfo") Group userInfo, Navigator nav, @FormField(name = "formUserError", group = "addUserInfo") CustomErrors err) { User user = new User(); userInfo.setProperties(user); user.setPassword(SecurityUtils.getPassword(user.getPassword())); try { userService.createUser(user); } catch (RepeatConfigureException rce) { err.setMessage("invalidUser"); return; } nav.redirectTo(WebConstant.USER_MANAGER_LINK); }