@RequestMapping(value = "/edit", method = RequestMethod.GET) public String edit(String pid, Model model) { if (!StringUtils.isBlank(pid)) { model.addAttribute("post", postManager.loadReadById(pid)); } model.addAttribute("categorys", categoryService.list()); return "backend/post/edit"; }
public EMailSender getMailOption() { EMailSender option = new EMailSender(); option.setHost(optionsService.getOptionValue("mail_host")); if (!StringUtils.isBlank(option.getHost())) { option.setPort(Integer.parseInt(optionsService.getOptionValue("mail_port"))); option.setUsername(optionsService.getOptionValue("mail_username")); option.setPassword(optionsService.getOptionValue("mail_password")); } else { option = null; } return option; }
/** * 从数据库中获取站点通用设置,不存在时返回null * * @return */ public GeneralOption getGeneralOption() { GeneralOption form = new GeneralOption(); form.setTitle(optionsService.getOptionValue(OptionConstants.TITLE)); if (!StringUtils.isBlank(form.getTitle())) { form.setSubtitle(optionsService.getOptionValue(OptionConstants.SUBTITLE)); form.setDescription(optionsService.getOptionValue(OptionConstants.DESCRIPTION)); form.setKeywords(optionsService.getOptionValue(OptionConstants.KEYWORDS)); form.setWeburl(optionsService.getOptionValue("weburl")); } else { form = null; } return form; }
@RequestMapping(value = "/edit", method = RequestMethod.GET) public String edit(String uid, Model model) { if (!StringUtils.isBlank(uid)) model.addAttribute("user", userService.loadById(uid)); return "backend/user/edit"; }