Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring MVC- Getting error when I try to use proxyMode=ScopedProxyMode.TARGET_CLASS

I am using Spring 3.1 in a java web app

Now, as per this website--> http://tedyoung.me/2011/10/19/practi...rt-5-sessions/ I can use the following annotations for a Global Session scoped class..

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 am getting this error in Eclipse IDE-->

ScopedProxyMode cannot be resolved to a variable

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.

like image 320
Arvind Avatar asked Feb 10 '26 01:02

Arvind


1 Answers

I think you are missing to import org.springframework.context.annotation.ScopedProxyMode.

like image 173
Arun P Johny Avatar answered Feb 12 '26 16:02

Arun P Johny



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!