@Validations( requiredStrings = { @RequiredStringValidator( type = ValidatorType.FIELD, fieldName = "group.name", message = "组名是必须的"), @RequiredStringValidator( type = ValidatorType.FIELD, fieldName = "group.comments", message = "描述是必须的") }) @Action("saveGroup") public String save() { Group groupForSave; if (this.group.getId() != 0) { groupForSave = groupDao.load(this.group.getId()); } else { groupForSave = new Group(); } this.mapper(groupForSave); this.groupDao.persist(groupForSave); return "index"; }
@SkipValidation @Action("eidtGroupView") public String editGroup() { if (this.groupId != 0) this.group = groupDao.load(this.groupId); return ActionSupport.INPUT; }