Assuming there is a bean in application scope called applicationPropertys and it were accessed in a JSP using EL,
${applicationPropertys.someProperty}
Would access be synchronised automatically? If not how can it be achieved?
secondly if all the property’s in the bean applicationPropertys were set once by a ServletContextListener and were all read only after that then I believe that the synchronisation would be unnecessary.
So if synchronisation is automatic then how can it be avoided to improve performance?
Should I just move all the applicationPropertys that I will need for a page into the page scope in the servlet controller then forward to the JSP and retrieve the needed property’s from page scope? Or is that worse than the synchronisation?
No.
By adding
synchronizedto thegetSomeProperty()method of the javabean class.That’s correct.
It’s not, so you don’t need to.