Redirect to another sub-domain with addition of flash attributes (RedirectAttributes) does not work

1

My question is related to adding attributes in the RedirectAttributes interface. I'm adding two flash attributes in the redirect, but the redirect does not only change the URI but the subdomain as seen in the method below:

@RequestMapping(value = "/access-agency", method = RequestMethod.GET)
public String acessLoginPage(@RequestParam(required = true) String email, final RedirectAttributes redirectAttributes, HttpServletRequest request){
    Login login = loginFacade.findByEmail(email);
    Agency agency = agencyFacade.findAgencyByTenantId(login.getTenantId());

    redirectAttributes.addFlashAttribute("inputFieldReadOnly", Boolean.TRUE);
    redirectAttributes.addFlashAttribute("employeeEmail", email);
    return "redirect:http://" + agency.getSubdomain() + "."+ request.getServerName().replaceAll(".*\.(?=.*\.)", "") + ":" + request.getServerPort() + request.getContextPath()+"/login";  
}

Unfortunately it does not work! Can anyone tell me if this is because I'm performing the redirect to another subdomain and

  

RedirectAttributes

Does it only work with changing URI?

    
asked by anonymous 23.03.2016 / 15:13

0 answers