Resolution: Won't Fix
Affects Version/s: None
Fix Version/s: Later
Number of attachments :
Currently, we create new ELResolvers for every ElContext (which is cached in the execution).
Better practice would be to make them reusable. Following resolvers should be re-factored:
Access of Execution and ApplicationContext in the resolvers should work with ElContext.getContext and ElContext.putContext, as proposed on the forum:
I was browsing the EL-related code in Activiti, where a point came into my mind:
The ExecutionVariableElResolver class needs an instance of Execution for looking up variables.
So, everytime an ELContext instance is needed, it is created with brand-new resolvers, so that execution can be set into them.
(I know it is cached for each execution)
But instead of creating resolvers everytime (I think they are stateless, except for ExecutionVariableElResolver)
you can set the execution in the ELContext using putContext method, and look it up in ExecutionVariableElResolver class using getContext method.
This is a more logical place, imho, to keep the execution in the el context object model.
And if any other resolvers need the execution instance in any way, is can be easier for them to access.