示例#1
0
 // 更新
 @Validations(
     requiredStrings = {
       @RequiredStringValidator(fieldName = "friendLink.name", message = "友情链接名称不允许为空!"),
       @RequiredStringValidator(fieldName = "friendLink.url", message = "链接地址不允许为空!")
     },
     intRangeFields = {
       @IntRangeFieldValidator(
           fieldName = "friendLink.orderList",
           min = "0",
           message = "排序必须为零或正整数!")
     })
 @InputConfig(resultName = "error")
 public String update() throws Exception {
   FriendLink persistent = friendLinkService.load(id);
   if (logo != null) {
     String logoPath = ImageUtil.copyImageFile(getServletContext(), logo);
     persistent.setLogoPath(logoPath);
   }
   BeanUtils.copyProperties(
       friendLink, persistent, new String[] {"id", "createDate", "modifyDate", "logoPath"});
   friendLinkService.update(persistent);
   redirectUrl = "friend_link!list.action";
   return SUCCESS;
 }
示例#2
0
 // 保存
 @Validations(
     requiredStrings = {
       @RequiredStringValidator(fieldName = "friendLink.name", message = "友情链接名称不允许为空!"),
       @RequiredStringValidator(fieldName = "friendLink.url", message = "链接地址不允许为空!")
     },
     intRangeFields = {
       @IntRangeFieldValidator(
           fieldName = "friendLink.orderList",
           min = "0",
           message = "排序必须为零或正整数!")
     })
 @InputConfig(resultName = "error")
 public String save() throws Exception {
   if (logo != null) {
     String logoPath = ImageUtil.copyImageFile(getServletContext(), logo);
     friendLink.setLogoPath(logoPath);
   } else {
     friendLink.setLogoPath(null);
   }
   friendLinkService.save(friendLink);
   redirectUrl = "friend_link!list.action";
   return SUCCESS;
 }
示例#3
0
 // 列表
 public String list() {
   pager = friendLinkService.findPager(pager);
   return LIST;
 }
示例#4
0
 // 删除
 public String delete() {
   friendLinkService.delete(ids);
   return ajax(Status.success, "删除成功!");
 }
示例#5
0
 // 编辑
 public String edit() {
   friendLink = friendLinkService.load(id);
   return INPUT;
 }