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); }
@Override public String toString() { return group.toString(); }
/** 将对象中的值置入当前group instance中。 */ public void mapTo(Object object) { group.mapTo(object); }
/** 判断这个group有没有被验证过。 */ public boolean isValidated() { return group.isValidated(); }
/** 取得所有的fields。 */ public Iterator<FieldHelper> getFields() { return new FieldHelperIterator(group.getFields().iterator()); }
/** 取得指定名称的field helper。 */ public FieldHelper get(String fieldName) { Field field = group.getField(fieldName); return field == null ? null : new FieldHelper(field); }