title: when accessing some action with ajax, and spring aspect throws an exception, how to redirect a certain page
body: <p>here is my test:
  TestAspect</p>
  
  <pre><code>@Component
  @Aspect
  public class TestAspect {
      @Before(value = "@annotation(testAnnotation)", argNames = "testAnnotation")
      public void test(TestAnnotation testAnnotation) throws RuntimeException {
          throw new RuntimeException("runtime exception");
      }
  }
  </code></pre>
  
  <hr>
  
  <p>TestAnnotation</p>
  
  <pre><code>@Retention(RetentionPolicy.RUNTIME)
  @Target(ElementType.METHOD)
  public @interface  TestAnnotation {
  
  }
  </code></pre>
  
  <hr>
  
  <p>TestAction</p>
  
  <pre><code>@Controller
  @Result(name = ActionSupport.SUCCESS, type = "json")
  public class TestAction extends ActionSupport {
  
      private static final long serialVersionUID = 2680952388896234662L;
  
      @TestAnnotation
      public String execute() {
          return SUCCESS;
      }
  
  }
  </code></pre>
  
  <hr>
  
  <p>Strust2 xml</p>
  
  <pre><code>&lt;package name="default" extends="convention-default,json-default"&gt;
          &lt;interceptors&gt;
              &lt;interceptor-stack name="mydefault"&gt;
                  &lt;interceptor-ref name="defaultStack" /&gt;
                  &lt;interceptor-ref name="json"&gt;
                      &lt;param name="ignoreHierarchy"&gt;false&lt;/param&gt;
                      &lt;param name="excludeNullProperties"&gt;true&lt;/param&gt;
                  &lt;/interceptor-ref&gt;
              &lt;/interceptor-stack&gt;
          &lt;/interceptors&gt;
          &lt;default-interceptor-ref name="mydefault" /&gt;
          &lt;global-results&gt;
  
              &lt;result name="error" type="redirect"&gt;/error.jsp&lt;/result&gt;
          &lt;/global-results&gt;
          &lt;global-exception-mappings&gt;
              &lt;exception-mapping
                  exception="java.lang.RuntimeException"
                  result="error" /&gt;
          &lt;/global-exception-mappings&gt;
      &lt;/package&gt;
  </code></pre>
  
  <p>if accessing test.action with ajax(jQuery),the error.jsp is returned in json type. How to make the browser redirect to the error.jsp.</p>
  
  <p>Please advise.</p>
  
  <p>Thanks a lot!! </p>