I have a web application using Struts 2 with Freemarker templates, and Spring 4.
I have a few configuration strings that are stored in a .properties
file which I need to render on every page (for example, our CDN path, which contains a version string). Right now these properties are read by Spring and stored in an instance of org.springframework.core.env.Environment
.
Is there an easy way to make my Environment
instance accessible to all of my views?
We have another application which does this through action inheritance, where a base class has a getEnvironment()
method. I dislike this approach as every action must extend the base class.