@RequestMapping(value = "/download", method = RequestMethod.GET) public String downloadSignedFile(@ModelAttribute("signedDocument") InMemoryDocument signedDocument, HttpServletResponse response) { try { MimeType mimeType = signedDocument.getMimeType(); if (mimeType != null) { response.setContentType(mimeType.getMimeTypeString()); } response.setHeader("Content-Transfer-Encoding", "binary"); response.setHeader("Content-Disposition", "attachment; filename=\"" + signedDocument.getName() + "\""); Utils.copy(new ByteArrayInputStream(signedDocument.getBytes()), response.getOutputStream()); } catch (Exception e) { logger.error("An error occured while pushing file in response : " + e.getMessage(), e); } return null; }
@RequestMapping("msg-info-export") public void export(@ModelAttribute Page page, @RequestParam Map<String, Object> parameterMap, HttpServletRequest request, HttpServletResponse response) throws Exception { List<PropertyFilter> propertyFilters = PropertyFilter .buildFromMap(parameterMap); page = msgInfoManager.pagedQuery(page, propertyFilters); List<MsgInfo> msgInfos = (List<MsgInfo>) page.getResult(); TableModel tableModel = new TableModel(); tableModel.setName("msg info"); tableModel.addHeaders("id", "name"); tableModel.setData(msgInfos); exportor.export(request, response, tableModel); }
@RequestMapping("stamp-info-save") public String save(@ModelAttribute StampInfo stampInfo, @RequestParam Map<String, Object> parameterMap, RedirectAttributes redirectAttributes) { String tenantId = tenantHolder.getTenantId(); StampInfo dest = null; Long id = stampInfo.getId(); if (id != null) { dest = stampInfoManager.get(id); beanMapper.copy(stampInfo, dest); } else { dest = stampInfo; dest.setTenantId(tenantId); } stampInfoManager.save(dest); messageHelper.addFlashMessage(redirectAttributes, "core.success.save", "保存成功"); return "redirect:/stamp/stamp-info-list.do"; }
@RequestMapping("msg-info-listSent") public String listSent(@ModelAttribute Page page, @RequestParam Map<String, Object> parameterMap, Model model) { String userId = currentUserHolder.getUserId(); List<PropertyFilter> propertyFilters = PropertyFilter .buildFromMap(parameterMap); propertyFilters.add(new PropertyFilter("EQS_senderId", userId)); page.setOrder("DESC"); page.setOrderBy("createTime"); page = msgInfoManager.pagedQuery(page, propertyFilters); model.addAttribute("page", page); return "msg/msg-info-listSent"; }
@RequestMapping(value = "/addStudent",method = RequestMethod.POST) public String addStudent(@ModelAttribute("student") @Validated Student student, BindingResult bindingResult,ModelMap model){ // if(bindingResult.hasErrors()){ // return "addStudent"; // } System.out.println("id = "+student.getId()); model.addAttribute("id",student.getId()); model.addAttribute("name",student.getName()); model.addAttribute("age",student.getAge()); model.addAttribute("receivePaper",student.isReceivePaper()); model.addAttribute("gender",student.getGender()); model.addAttribute("color",student.getColor()); model.addAttribute("city",student.getCity()); model.addAttribute("tec",student.getTec()); return "result"; }
@RequestMapping("train-info-export") public void export(@ModelAttribute Page page, @RequestParam Map<String, Object> parameterMap, HttpServletRequest request, HttpServletResponse response) throws Exception { String tenantId = tenantHolder.getTenantId(); List<PropertyFilter> propertyFilters = PropertyFilter .buildFromMap(parameterMap); propertyFilters.add(new PropertyFilter("EQS_tenantId", tenantId)); page = trainInfoManager.pagedQuery(page, propertyFilters); List<TrainInfo> trainInfos = (List<TrainInfo>) page.getResult(); TableModel tableModel = new TableModel(); tableModel.setName("train info"); tableModel.addHeaders("id", "name"); tableModel.setData(trainInfos); exportor.export(request, response, tableModel); }
@RequestMapping("group-info-save") public String save(@ModelAttribute GroupInfo groupInfo, @RequestParam Map<String, Object> parameterMap, RedirectAttributes redirectAttributes) { String tenantId = tenantHolder.getTenantId(); GroupInfo dest = null; Long id = groupInfo.getId(); if (id != null) { dest = groupInfoManager.get(id); beanMapper.copy(groupInfo, dest); } else { dest = groupInfo; dest.setTenantId(tenantId); } groupInfoManager.save(dest); messageHelper.addFlashMessage(redirectAttributes, "core.success.save", "保存成功"); return "redirect:/group/group-info-list.do"; }
@RequestMapping(value = "/logon.sf", method = RequestMethod.POST) public String logonMethod( @ModelAttribute("logon") Logon logon, BindingResult result, SessionStatus status) { logonValidator.validate(logon, result); if (result.hasErrors()) { //if validator failed return "login"; } else { status.setComplete(); //form success return "securepage"; } }
@RequestMapping("form-template-export") public void export(@ModelAttribute Page page, @RequestParam Map<String, Object> parameterMap, HttpServletRequest request, HttpServletResponse response) throws Exception { String tenantId = tenantHolder.getTenantId(); List<PropertyFilter> propertyFilters = PropertyFilter .buildFromMap(parameterMap); propertyFilters.add(new PropertyFilter("EQS_tenantId", tenantId)); page = formTemplateManager.pagedQuery(page, propertyFilters); List<FormTemplate> dynamicModels = (List<FormTemplate>) page .getResult(); TableModel tableModel = new TableModel(); tableModel.setName("dynamic model"); tableModel.addHeaders("id", "name"); tableModel.setData(dynamicModels); exportor.export(request, response, tableModel); }
@RequestMapping("contract-info-save") public String save(@ModelAttribute ContractInfo contractInfo, @RequestParam Map<String, Object> parameterMap, RedirectAttributes redirectAttributes) { String tenantId = tenantHolder.getTenantId(); ContractInfo dest = null; Long id = contractInfo.getId(); if (id != null) { dest = contractInfoManager.get(id); beanMapper.copy(contractInfo, dest); } else { dest = contractInfo; dest.setTenantId(tenantId); } contractInfoManager.save(dest); messageHelper.addFlashMessage(redirectAttributes, "core.success.save", "保存成功"); return "redirect:/contract/contract-info-list.do"; }
@RequestMapping("bpm-conf-operation-save") public String save(@ModelAttribute BpmConfOperation bpmConfOperation, @RequestParam("bpmConfNodeId") Long bpmConfNodeId) { if ((bpmConfOperation.getValue() == null) || "".equals(bpmConfOperation.getValue())) { return "redirect:/bpm/bpm-conf-operation-list.do?bpmConfNodeId=" + bpmConfNodeId; } bpmConfOperation.setBpmConfNode(bpmConfNodeManager.get(bpmConfNodeId)); bpmConfOperationManager.save(bpmConfOperation); BpmConfOperation dest = bpmConfOperation; String taskDefinitionKey = dest.getBpmConfNode().getCode(); String processDefinitionId = dest.getBpmConfNode().getBpmConfBase() .getProcessDefinitionId(); String operation = dest.getValue(); taskDefinitionConnector.addOperation(taskDefinitionKey, processDefinitionId, operation); return "redirect:/bpm/bpm-conf-operation-list.do?bpmConfNodeId=" + bpmConfNodeId; }
@RequestMapping("budget-info-export") public void export(@ModelAttribute Page page, @RequestParam Map<String, Object> parameterMap, HttpServletRequest request, HttpServletResponse response) throws Exception { String tenantId = tenantHolder.getTenantId(); List<PropertyFilter> propertyFilters = PropertyFilter .buildFromMap(parameterMap); propertyFilters.add(new PropertyFilter("EQS_tenantId", tenantId)); page = budgetInfoManager.pagedQuery(page, propertyFilters); List<BudgetInfo> budgetInfos = (List<BudgetInfo>) page.getResult(); TableModel tableModel = new TableModel(); tableModel.setName("budget info"); tableModel.addHeaders("id", "name"); tableModel.setData(budgetInfos); exportor.export(request, response, tableModel); }
/** * Maps and handles custom behavior in the Edit page (POST mode) * @param message The information that is bound to the HTML form and used to update the database * @return Custom message sent to the client - in this case, a redirect */ @RequestMapping(value="/edit", method=RequestMethod.POST) public String submit(@ModelAttribute Message message) { try { String username = Util.getUsername(); message.setUsername(username); message = encryptMessage(message); messageRepository.save(message); // TO-DO: redirect and show a success message return "redirect:/cpanel.html"; } catch(DataIntegrityViolationException ex) // message is too long for DB field { return "redirect:/edit?error"; } }
@RequestMapping("template-field-save") public String save(@ModelAttribute TemplateField templateField, @RequestParam("infoId") Long infoId, RedirectAttributes redirectAttributes) { String tenantId = tenantHolder.getTenantId(); Long id = templateField.getId(); TemplateField dest = null; if (id != null) { dest = templateFieldManager.get(id); beanMapper.copy(templateField, dest); } else { dest = templateField; dest.setTenantId(tenantId); } dest.setTemplateInfo(templateInfoManager.get(infoId)); templateFieldManager.save(dest); messageHelper.addFlashMessage(redirectAttributes, "core.success.save", "保存成功"); return "redirect:/template/template-field-list.do"; }
@RequestMapping("pim-info-save") public String save(@ModelAttribute PimInfo pimInfo, RedirectAttributes redirectAttributes) { String userId = currentUserHolder.getUserId(); String tenantId = tenantHolder.getTenantId(); Long id = pimInfo.getId(); PimInfo dest = null; if (id != null) { dest = pimInfoManager.get(id); beanMapper.copy(pimInfo, dest); } else { dest = pimInfo; dest.setUserId(userId); dest.setTenantId(tenantId); } pimInfoManager.save(dest); messageHelper.addFlashMessage(redirectAttributes, "core.success.save", "保存成功"); return "redirect:/pim/pim-info-list.do"; }
/** * Populates the form for creating an event with valid information. Useful so that users do not have to think when * filling out the form for testing. * * @param createEventForm * @return */ @RequestMapping(value = "/new", params = "auto") public String createEventFormAutoPopulate(@ModelAttribute CreateEventForm createEventForm) { // provide default values to make user submission easier createEventForm.setSummary("A new event...."); createEventForm.setDescription("This was autopopulated to save time creating a valid event."); createEventForm.setWhen(Calendar.getInstance()); // make the attendee not the current user CalendarUser currentUser = userContext.getCurrentUser(); int attendeeId = currentUser.getId() == 0 ? 1 : 0; CalendarUser attendee = calendarService.getUser(attendeeId); createEventForm.setAttendeeEmail(attendee.getEmail()); return "events/create"; }
@RequestMapping("sendsms-config-save") public String save(@ModelAttribute SendsmsConfig sendsmsConfig, RedirectAttributes redirectAttributes) { Long id = sendsmsConfig.getId(); SendsmsConfig dest = null; if (id != null) { dest = sendsmsConfigManager.get(id); beanMapper.copy(sendsmsConfig, dest); } else { dest = sendsmsConfig; } sendsmsConfigManager.save(dest); messageHelper.addFlashMessage(redirectAttributes, "core.success.save", "保存成功"); return "redirect:/sendsms/sendsms-config-list.do"; }
@RequestMapping("workcal-rule-export") public void export(@ModelAttribute Page page, @RequestParam Map<String, Object> parameterMap, HttpServletRequest request, HttpServletResponse response) throws Exception { String tenantId = tenantHolder.getTenantId(); List<PropertyFilter> propertyFilters = PropertyFilter .buildFromMap(parameterMap); propertyFilters.add(new PropertyFilter("EQS_tenantId", tenantId)); page = workcalRuleManager.pagedQuery(page, propertyFilters); List<WorkcalRule> workcalRules = (List<WorkcalRule>) page.getResult(); TableModel tableModel = new TableModel(); tableModel.setName("workcalRule"); tableModel.addHeaders("id", "name"); tableModel.setData(workcalRules); exportor.export(request, response, tableModel); }
@RequestMapping("dict-type-export") public void export(@ModelAttribute Page page, @RequestParam Map<String, Object> parameterMap, HttpServletRequest request, HttpServletResponse response) throws Exception { String tenantId = tenantHolder.getTenantId(); List<PropertyFilter> propertyFilters = PropertyFilter .buildFromMap(parameterMap); propertyFilters.add(new PropertyFilter("EQS_tenantId", tenantId)); page = dictTypeManager.pagedQuery(page, propertyFilters); List<DictType> dictTypes = (List<DictType>) page.getResult(); TableModel tableModel = new TableModel(); tableModel.setName("dict info"); tableModel.addHeaders("id", "name", "stringValue", "description"); tableModel.setData(dictTypes); exportor.export(request, response, tableModel); }
@RequestMapping("business-info-save") public String save(@ModelAttribute BusinessInfo businessInfo, @RequestParam Map<String, Object> parameterMap, RedirectAttributes redirectAttributes) { String tenantId = tenantHolder.getTenantId(); BusinessInfo dest = null; Long id = businessInfo.getId(); if (id != null) { dest = businessInfoManager.get(id); beanMapper.copy(businessInfo, dest); } else { dest = businessInfo; dest.setTenantId(tenantId); } businessInfoManager.save(dest); messageHelper.addFlashMessage(redirectAttributes, "core.success.save", "保存成功"); return "redirect:/business/business-info-list.do"; }
@RequestMapping("job-save") public String save(@ModelAttribute JobUser jobUser, @RequestParam("jobId") long jobId, RedirectAttributes redirectAttributes) { String tenantId = tenantHolder.getTenantId(); JobUser dest = null; Long id = jobUser.getId(); if (id != null) { dest = jobUserManager.get(id); beanMapper.copy(jobUser, dest); } else { dest = jobUser; dest.setTenantId(tenantId); } dest.setJobInfo(jobInfoManager.get(jobId)); jobUserManager.save(dest); messageHelper.addFlashMessage(redirectAttributes, "core.success.save", "保存成功"); return "redirect:/org/job-list.do"; }
@RequestMapping("account-online-save") public String save(@ModelAttribute AccountOnline accountOnline, @RequestParam Map<String, Object> parameterMap, RedirectAttributes redirectAttributes) { String tenantId = tenantHolder.getTenantId(); AccountOnline dest = null; Long id = accountOnline.getId(); if (id != null) { dest = accountOnlineManager.get(id); beanMapper.copy(accountOnline, dest); } else { dest = accountOnline; dest.setTenantId(tenantId); } accountOnlineManager.save(dest); messageHelper.addFlashMessage(redirectAttributes, "core.success.save", "保存成功"); return "redirect:/user/account-online-list.do"; }
@RequestMapping(value = "/category/create", method = RequestMethod.POST) public String createCategory(@Valid @ModelAttribute CategoryDTO categoryDTO, BindingResult br, RedirectAttributes attr){ if(br.hasErrors()){ StringBuilder errorMsg = new StringBuilder(); for(ObjectError i : br.getAllErrors()){ errorMsg.append(i.getDefaultMessage()); } attr.addFlashAttribute("error", errorMsg.toString()); return "redirect:/oups"; } Category category = new Category(); category.setCategoryName(categoryDTO.getCategoryNew()); try{ categoryService.saveCategory(category); categoryService.uploadCategoryStarterFiles(categoryDTO.getCategoryNew()); }catch (Exception e){ attr.addFlashAttribute("error", "Could not create category. Please contact our support team."); return "redirect:/oups"; } attr.addFlashAttribute("categoryDTO", categoryDTO); return "redirect:/admin"; }
@RequestMapping("bpm-category-save") public String save(@ModelAttribute BpmCategory bpmCategory, RedirectAttributes redirectAttributes) { BpmCategory dest = null; Long id = bpmCategory.getId(); if (id != null) { dest = bpmCategoryManager.get(id); beanMapper.copy(bpmCategory, dest); } else { dest = bpmCategory; String tenantId = tenantHolder.getTenantId(); dest.setTenantId(tenantId); } bpmCategoryManager.save(dest); messageHelper.addFlashMessage(redirectAttributes, "core.success.save", "保存成功"); return "redirect:/bpm/bpm-category-list.do"; }
@RequestMapping("seat-info-export") public void export(@ModelAttribute Page page, @RequestParam Map<String, Object> parameterMap, HttpServletRequest request, HttpServletResponse response) throws Exception { String tenantId = tenantHolder.getTenantId(); List<PropertyFilter> propertyFilters = PropertyFilter .buildFromMap(parameterMap); propertyFilters.add(new PropertyFilter("EQS_tenantId", tenantId)); page = seatInfoManager.pagedQuery(page, propertyFilters); List<SeatInfo> seatInfos = (List<SeatInfo>) page.getResult(); TableModel tableModel = new TableModel(); tableModel.setName("seat info"); tableModel.addHeaders("id", "name"); tableModel.setData(seatInfos); exportor.export(request, response, tableModel); }
@RequestMapping(value = "/register", method = RequestMethod.POST) public String doRegister(@Valid @ModelAttribute UserModel newUserModel, BindingResult bindingResult, Model model) { if (newUserModel.getPassword().length() < 14) return "register2"; else { // Password encryption newUserModel.setPassword(passwordEncoder.encode(newUserModel.getPassword())); userRepository.save(newUserModel); // Create user-role for the user UserRoleModel role = new UserRoleModel(); role.setRole("ROLE_USER"); role.setUser(newUserModel); userRoleRepository.save(role); //Send verification mail SimpleMailMessage msg = new SimpleMailMessage(this.customMailMessage); msg.setTo(newUserModel.getEmail_address()); msg.setText(String.format(msg.getText(), newUserModel.getUsername(), "http://localhost:8080/Towan/verification?id="+newUserModel.getUserId())); this.mailSender.send(msg); return "verifyInfo"; } }
@RequestMapping("list-owners") public ModelAndView findUsers(@ModelAttribute("owner") FindOwnerDTO owner, @RequestParam(name = "initialPage", value = "", required = false) String initialPage) { ModelAndView mv = new ModelAndView("users/list-owners"); mv.addObject("navActive", NavIds.getInstance().getOwners()); int page = 0; int size = 5; if (StringUtils.isNumeric(initialPage)) { page = Integer.valueOf(initialPage); } mv.addObject("owners", ownerService.findBy(owner, page, size)); return mv; }
@RequestMapping("whitelist-type-save") public String save(@ModelAttribute WhitelistType whitelistType, RedirectAttributes redirectAttributes) { String tenantId = tenantHolder.getTenantId(); Long id = whitelistType.getId(); WhitelistType dest = null; if (id != null) { dest = whitelistTypeManager.get(id); beanMapper.copy(whitelistType, dest); } else { dest = whitelistType; dest.setTenantId(tenantId); } whitelistTypeManager.save(dest); messageHelper.addFlashMessage(redirectAttributes, "core.success.save", "保存成功"); return "redirect:/whitelist/whitelist-type-list.do"; }
@PostMapping("/result_game") public String mediaGameSubmit(@ModelAttribute Media media, Model model, HttpServletRequest request ) { LinkedList<GameInfo> a = null; String maxResult= media.getMaxResult(); if(media.getTitle().equals("")) return "media_game"; if (maxResult.equals("")) maxResult="10"; try { a = APIOperations.gameGetInfo(media.getTitle(),maxResult,media.getOrderBy()); } catch (UnirestException e) { e.printStackTrace(); return String.valueOf(HttpStatus.INTERNAL_SERVER_ERROR); } RabbitSend.sendMediaRequest(media.getTitle(),"Game",request); if (a.size()==0) return "no_result"; model.addAttribute("mediaList", a); return "result_game"; }
@RequestMapping("party-struct-list") public String list(@ModelAttribute Page page, @RequestParam Map<String, Object> parameterMap, Model model) { String tenantId = tenantHolder.getTenantId(); List<PropertyFilter> propertyFilters = PropertyFilter .buildFromMap(parameterMap); propertyFilters.add(new PropertyFilter("EQS_tenantId", tenantId)); page = partyStructManager.pagedQuery(page, propertyFilters); List<PartyStructType> partyStructTypes = partyStructTypeManager.findBy( "tenantId", tenantId); model.addAttribute("page", page); model.addAttribute("partyStructTypes", partyStructTypes); return "party/party-struct-list"; }
@RequestMapping("leave-info-save") public String save(@ModelAttribute LeaveInfo leaveInfo, @RequestParam Map<String, Object> parameterMap, RedirectAttributes redirectAttributes) { String tenantId = tenantHolder.getTenantId(); LeaveInfo dest = null; Long id = leaveInfo.getId(); if (id != null) { dest = leaveInfoManager.get(id); beanMapper.copy(leaveInfo, dest); } else { dest = leaveInfo; dest.setTenantId(tenantId); } leaveInfoManager.save(dest); messageHelper.addFlashMessage(redirectAttributes, "core.success.save", "保存成功"); return "redirect:/leave/leave-info-list.do"; }
@RequestMapping("bpm-mail-template-save") public String save(@ModelAttribute BpmMailTemplate bpmMailTemplate, RedirectAttributes redirectAttributes) { BpmMailTemplate dest = null; Long id = bpmMailTemplate.getId(); if (id != null) { dest = bpmMailTemplateManager.get(id); beanMapper.copy(bpmMailTemplate, dest); } else { dest = bpmMailTemplate; } bpmMailTemplateManager.save(dest); messageHelper.addFlashMessage(redirectAttributes, "core.success.save", "保存成功"); return "redirect:/bpm/bpm-mail-template-list.do"; }
@RequestMapping("report-info-save") public String save(@ModelAttribute ReportInfo reportInfo, @RequestParam("queryId") Long queryId, RedirectAttributes redirectAttributes) { String userId = currentUserHolder.getUserId(); String tenantId = tenantHolder.getTenantId(); Long id = reportInfo.getId(); ReportInfo dest = null; if (id != null) { dest = reportInfoManager.get(id); beanMapper.copy(reportInfo, dest); } else { dest = reportInfo; } dest.setReportQuery(reportQueryManager.get(queryId)); reportInfoManager.save(dest); messageHelper.addFlashMessage(redirectAttributes, "core.success.save", "保存成功"); return "redirect:/report/report-info-list.do"; }
@RequestMapping("bpm-mail-template-export") public void export(@ModelAttribute Page page, @RequestParam Map<String, Object> parameterMap, HttpServletRequest request, HttpServletResponse response) throws Exception { List<PropertyFilter> propertyFilters = PropertyFilter .buildFromMap(parameterMap); page = bpmMailTemplateManager.pagedQuery(page, propertyFilters); List<BpmMailTemplate> bpmCategories = (List<BpmMailTemplate>) page .getResult(); TableModel tableModel = new TableModel(); tableModel.setName("bpm-process"); tableModel.addHeaders("id", "name"); tableModel.setData(bpmCategories); exportor.export(request, response, tableModel); }
@RequestMapping("product-info-save") public String save(@ModelAttribute ProductInfo productInfo, @RequestParam Map<String, Object> parameterMap, RedirectAttributes redirectAttributes) { String tenantId = tenantHolder.getTenantId(); ProductInfo dest = null; Long id = productInfo.getId(); if (id != null) { dest = productInfoManager.get(id); beanMapper.copy(productInfo, dest); } else { dest = productInfo; dest.setTenantId(tenantId); } productInfoManager.save(dest); messageHelper.addFlashMessage(redirectAttributes, "core.success.save", "保存成功"); return "redirect:/product/product-info-list.do"; }
@PostMapping public String signInPost(@ModelAttribute SignIn signin) { if ("john".equals(signin.getUsername()) && "secret".equals(signin.getPassword())) { return "success"; } else { return "failure"; } }
@RequestMapping(value="/updateFullProfile", method = RequestMethod.POST) public AsyncResponseEntity<User> updateFullProfile(@ModelAttribute User user, @ModelAttribute UserImageDto imageDto) { return makeAsyncResponse(userService.edit(user, imageDto).map(i->{ publishMessage(i.getId(), i); return i; }), HttpStatus.ACCEPTED); }
@RequestMapping(value = "/create", method = { RequestMethod.POST }) public String crea(@ModelAttribute User user) { Role userRole = new Role(); userRole.setId(Role.USER_ROLE_ID); user.getRoles().add(userRole); user.setPassword(DigestUtils.md5Hex(user.getPassword())); userService.create(user); // authenticate the user and redirect on the welcome page new AuthenticationHolder().updateUser(userService.findByPK(user.getId())); return "redirect:/dashboard"; }
@PostMapping(value = "/complete/registration", headers = "Accept=application/json", params = "action=Activate") @ResponseStatus(value = HttpStatus.ACCEPTED) public String completeInstitutionRegistration(@ModelAttribute final RegistrationRequest request, final Map<String, Object> model) { LOGGER.info("Applying to register by potential institution"); String validationResult = userService.validatePassword(request.getNewPassword(), request.getRepeatedNewPassword()); if (!validationResult.equals("success")) { model.put("passwordError", true); model.put("passwordErrorMessage", validationResult); } else if (!userService.completeInstitutionRegistration(request)) { model.put("invalidEmail", true); } else { model.put("activated", true); } return "registration"; }