67,512
社区成员
发帖
与我相关
我的任务
分享
@Component("groupaction")
@Scope("prototype")
public class GroupAction extends BaseAction implements ModelDriven{
final static Logger log = Logger.getLogger(GroupAction.class);
private GroupFormBean gfb = new GroupFormBean();
private IGroupService groupService;
private IRoleService roleService;
public GroupAction(){
log.debug("构造了action:"+this);
}
public IRoleService getRoleService() {
return roleService;
}
@Resource(name="roleService")
public void setRoleService(IRoleService roleService) {
this.roleService = roleService;
}
public IGroupService getGroupService() {
return groupService;
}
@Resource(name="groupService")
public void setGroupService(IGroupService groupService) {
log.debug("注入groupService:"+groupService);
this.groupService = groupService;
log.debug("gsID:"+groupService);
}
public String add()throws Exception{
String returnValue=SUCCESS;
log.debug("获取到的gfb对象:"+gfb);
try {
groupService.addByDto(gfb);
log.info("添加群组成功");
} catch (Exception e) {
log.error("添加群组异常。原因:"+e.getMessage());
throw e;
}
return returnValue;
}
public Object getModel() {
return gfb;
}
}