title: Redirect to an Angular route from server side using Spring Boot
body: <p>My app is composed of 2 modules: an Angular 5 <code>uimodule</code> and a Spring Boot REST <code>servermodule</code>. I am using the <code>frontend-maven-plugin</code> to build the <code>uimodule</code> and copy its resources files into <code>META-INF/resources</code> folder to help Spring Boot discovering them. So the 2 modules run in the same domain (<code>http://localhost:8080</code>).</p>
  
  <p>Now I am struggled with the implementation of the point 3 of this workflow:</p>
  
  <p>1-A user registers in the application (<code>uimodule</code> posts users's data to the server)</p>
  
  <p>2-After received data, the <code>servermodule</code> sends a validation mail to the user with validation link.</p>
  
  <p>3-When the user clicks on the link, the server validates the user and should <strong>redirect him to the login page.</strong></p>
  
  <p>The <code>/login</code> route already exists in the <code>uimodule</code>. Now my question is: </p>
  
  <p>How can I redirect the user to the login route from the server side?</p>
  
  <p>I tried this, but not work : </p>
  
  <pre><code>@Controller
  @RequestMapping( "/activate" )
  public class ActivationController {
  
    @GetMapping
    public String activate() {
      return "redirect:/login";
    }
  }
  </code></pre>
  
  <p>The same route (<code>http://localhost:8080/login</code>) works when I click on the defined login button (in <code>index.html</code>) but doesn't work when it comes from the server or when I write it manually (I got a 404 error)</p>
  
  <p>Help!</p>