title: Using @CrossOrigin in Spring Boot
body: <p>I'm using latest Spring Boot (1.2.7.RELEASE). I would like to use the <a href="https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/web/bind/annotation/CrossOrigin.html" rel="nofollow noreferrer"><code>@CrossOrigin</code></a> annotation from the package <code>org.springframework.web.bind.annotation</code> as described in <a href="http://docs.spring.io/spring/docs/4.2.2.RELEASE/spring-framework-reference/htmlsingle/#cors" rel="nofollow noreferrer"><strong>CORS Support</strong></a> section in Spring docs.</p>
  
  <p>I'd think I already have all the necessary dependencies (via Spring Boot defaults), but this is confusing: <code>CrossOrigin</code> is not found, even though stuff like <code>RestController</code> from the same package works!</p>
  
  <p><a href="https://i.stack.imgur.com/zUrV5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zUrV5.png" alt="enter image description here"></a></p>
  
  <pre><code>Error:(8, 47) java: cannot find symbol
    symbol:   class CrossOrigin
    location: package org.springframework.web.bind.annotation
  </code></pre>
  
  <p>What's going on? Has <code>CrossOrigin</code> been removed from later versions of Spring-MVC, or am I missing some dependency?</p>
  
  <p>pom.xml:</p>
  
  <pre><code>&lt;parent&gt;
      &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
      &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
      &lt;version&gt;1.2.7.RELEASE&lt;/version&gt;
  &lt;/parent&gt;
  
  &lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-actuator&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  </code></pre>