title: Spring MVC- Getting error when I try to use proxyMode=ScopedProxyMode.TARGET_CLASS
body: <p>I am using Spring 3.1 in a java web app</p>
  
  <p>Now, as per this website--> <a href="http://tedyoung.me/2011/10/19/practi...rt-5-sessions/" rel="nofollow">http://tedyoung.me/2011/10/19/practi...rt-5-sessions/</a>
  I can use the following annotations for a Global Session scoped class..</p>
  
  <p>Code:</p>
  
  <pre><code>@Component
  @Scope(value="session", proxyMode=ScopedProxyMode.TARGET_CLASS)
  public class UserPreferences {
  ....remaining code....
  </code></pre>
  
  <p>However, in my Java class, when I use the above annotations, I am getting this error in Eclipse IDE--></p>
  
  <blockquote>
    <p>ScopedProxyMode cannot be resolved to a variable</p>
  </blockquote>
  
  <p>What am I doing wrong here? I basically want to use a specific object across global session - viz, across multiple controllers in my Spring MVC based web app. </p>