title: Overriding default OPTIONS method in SpringBoot
body: <p>I have a rest-controller(SPRINGBOOT) with custom 'OPTIONS' method implemented.
  The problem is: when i make an ajax call to this 'OPTIONS' method, I get two responses one by default and the other from the implemented one. Where is the second response coming from. If it is from the default handling of 'OPTIONS' method in SPRINGBOOT, how to disable it ?</p>
  
  <p>My Rest Controller looks like this:</p>
  
  <pre><code>@RestController
  public class FetchOnPremData {
  
      @RequestMapping(value = "/fetchData/{jiraid}", method = RequestMethod.OPTIONS)
      public int options(@PathVariable String jiraid ,HttpServletResponse response) {
          response.setHeader("Access-Control-Allow-Methods","GET,HEAD,POST");
          response.setHeader("Allow", "HEAD,GET,PUT,OPTIONS");
          response.setHeader("Access-Control-Allow-Origin","*");
          return 234;
      }
  }
  </code></pre>
  
  <p>AJAX call made by me looks like this:</p>
  
  <pre><code>   $.ajax({
  
      type: 'OPTIONS',
      context: this,
        url: "https://myserverurl/fetchData/CFNDGEMINI-128",
        success: function(oResponseStatus, xhr) 
      {if (oResponseStatus === 234) {
  console.log("valid");}
       else {
      console.log("invalid");                                                                                   
      }
  </code></pre>
  
  <p>EDIT:
  <a href="https://stackoverflow.com/questions/33331042/how-to-handle-http-options-requests-in-spring-boot">How to handle HTTP OPTIONS requests in Spring Boot?</a></p>
  
  <p>this question addresses the problem of OPTIONS method not being invoked. In my case, OPTIONS method is working but another OPTIONS method is also giving a response. My question is asking about where the other response is coming from.</p>