Fórum

avoid sharing of global variables using spring in liferay

himanshu kaushik, modificado 9 Anos atrás.

avoid sharing of global variables using spring in liferay

New Member Postagens: 2 Data de Entrada: 09/07/14 Postagens Recentes
We are facing one issue while using spring @controller in liferay. While we are using global variables in our controller, the value of global variable is getting shared among all session i.e. for every new request across browser. This is due to its singleton nature.
This prompted us to do small POC on independent spring code in which we used @Component and @Scope (value="session", proxyMode=ScopedProxyMode.TARGET_CLASS) on the class we are using as global variable and by autowiring the global variable. This helped in resolving our issue.
But the same when implemented with liferay is proving to be complete waste. As the null values of properties of DTO (my global variable) are being received but not changing while we are operating on it in controller.
Hope that the issue has been made clear. Please suggest.