Spring MVC- Error trying to use proxyMode = ScopedProxyMode.TARGET_CLASS

I am using Spring 3.1 in java web application

Now, according to this site -> http://tedyoung.me/2011/10/19/practi...rt-5-sessions/ I can use the following annotations for a class with a global session.

code:

@Component
@Scope(value="session", proxyMode=ScopedProxyMode.TARGET_CLASS)
public class UserPreferences {
....remaining code....

      

However, in my Java class, when I use the above annotations, I get this error in Eclipse IDE ->

ScopedProxyMode cannot be resolved to variable

What am I doing wrong here? Basically I want to use a specific object in a global session, namely across multiple controllers in my Spring MVC based web application.

+3


source to share


2 answers


I think you are missing imports org.springframework.context.annotation.ScopedProxyMode

.



+9


source


You have to refresh your project and press ctrl + 1 on the code error line in eclipse and select the package to import. Otherwise, you must explicitly import org.springframework.context.annotation.ScopedProxyMode



0


source







All Articles