@RequestMapping("/saveOrUpdatePackageType") public String saveOrUpdatePackageType( @ModelAttribute("packageType") PackageType packageType, HttpSession session) { Boolean isContinue = packageType.getContinue(); packageType = packageService.saveOrUpdatePackageType(packageType); if (isContinue) { return "redirect:/package/editPackageType/0"; } return "redirect:/package/packageType"; }
@RequestMapping("/editPackageType/{id}") public String editPackageType( @PathVariable Integer id, @ModelAttribute PackageType packageType, HttpServletRequest request) { packageType.setId(null); if (id != 0) { PackageType tmp = packageService.findPackageTypeByPackageTypeId(id); BeanUtils.copyProperties(tmp, packageType); } return "packageType_edit"; }