public ActionForward inputValidationCode(
      ActionMapping mapping,
      ActionForm actionForm,
      HttpServletRequest request,
      HttpServletResponse response) {
    final String code = (String) getFromRequest(request, "validationCode");
    final String extId = (String) getFromRequest(request, "partyContactValidation");

    if (StringUtils.isEmpty(code) || StringUtils.isEmpty(extId)) {
      addActionMessage("contacts", request, "error.contacts.validation.token.empty");
      return mapping.findForward("inputValidationCode");
    }
    PartyContactValidation partyContactValidation;

    final PhysicalAddressValidationBean validationBean =
        getRenderedObject("physicalAddressValidationBean");
    if (validationBean != null) {
      partyContactValidation = validationBean.getValidation();
    } else {
      partyContactValidation = FenixFramework.getDomainObject(extId);
      partyContactValidation.processValidation(code);
    }
    return forwardToInputValidationCode(
        mapping, actionForm, request, response, partyContactValidation.getPartyContact());
  }
 public ActionForward requestValidationToken(
     ActionMapping mapping,
     ActionForm actionForm,
     HttpServletRequest request,
     HttpServletResponse response) {
   final String partyContactExtId = request.getParameter("partyContactValidation");
   final PartyContactValidation partyContactValidation =
       FenixFramework.getDomainObject(partyContactExtId);
   final PartyContact partyContact = partyContactValidation.getPartyContact();
   PartyContactBean contactBean = PartyContactBean.createFromDomain(partyContact);
   partyContact.triggerValidationProcess();
   addWarningMessage(request, contactBean);
   return forwardToInputValidationCode(mapping, actionForm, request, response, partyContact);
 }
 public ActionForward forwardToInputValidationCode(
     ActionMapping mapping,
     ActionForm actionForm,
     HttpServletRequest request,
     HttpServletResponse response,
     PartyContact partyContact) {
   if (partyContact == null || !isToBeValidated(partyContact)) {
     return backToShowInformation(mapping, actionForm, request, response);
   }
   final PartyContactValidation partyContactValidation = partyContact.getPartyContactValidation();
   request.setAttribute("partyContactValidation", partyContactValidation.getExternalId());
   request.setAttribute("valid", partyContactValidation.isValid());
   request.setAttribute("tries", partyContactValidation.getAvailableTries());
   if (partyContact instanceof PhysicalAddress) {
     request.setAttribute("isPhysicalAddress", true);
     request.setAttribute(
         "physicalAddressBean", new PhysicalAddressBean((PhysicalAddress) partyContact));
   }
   request.setAttribute("partyContact", PartyContactBean.createFromDomain(partyContact));
   request.setAttribute(
       "canValidateRequests", ((Person) partyContact.getParty()).getCanValidateContacts());
   return mapping.findForward("inputValidationCode");
 }