title: Spring aspects forward and cancel previous request
body: <p>Here is my question</p>
  
  <p>I want to intercept request before any spring controller call, check and modify request URI. After that it has to call another SPRING controller method. </p>
  
  <p>I used mvc:interceptors however I want to configure it with annotations thats why I need a solution for @Aspect. Everything is working but controller called twice, for the original request and for the new request. Using interceptors I return false and it cancels it, how do I do about Aspect classes? Thank you</p>
  
  <p>Here is my code:</p>
  
  <pre><code>@Component
  @Aspect
  public class TestAspect {
  
      @Before("execution(* mycontroller.*(..))  &amp;&amp;" + "args(request,response)")
      public void interceptUrl(HttpServletRequest request, HttpServletResponse response) {
  
          System.out.println("@Aspect is running!");
          System.out.println(request.getRequestURI());
  
          if (request.getAttribute("client") == null) {
              request.setAttribute("client", "test");
              request.getRequestDispatcher("/newpath/contact").forward(request, response);
          }
  
      }
  
  }
  </code></pre>