I have service controller which functionality I would like to reuse in another controller. Here is my service controller
@Controller
@Service
@Scope("session")
public class Controller1{
...
}
Here is my second controller
@Controller
public class Controller2 {
@Autowired
private Controller1 adminController;
...
}
But I'm getting exception which says:
Error creating bean with name 'adminController': Scope 'session' is not active for the current thread; consider defining a scoped proxy for this bean if you intend to refer to it from a singleton;
I think that this is because Controler1 is session-scoped bean and Controller2 is application. How can I reuse then Controller1 functionality inside Controller2? Thanks.