I want to display the name on every site of my grails app (this is not the app.name). Let's assume it is in the headline of the layout.
<h1>My app name</h1>
I would like to set this value at runtime and be able to edit it. My first idea was to store this value in a domain class. But then every controller action has to pass this domain object to the view.
So my questions are:
You can put things like this in a (singleton scoped) service and back it by domain object (e.g. key, value, locale) or by config (or both). Make the service listen into the livecycle events to load the values once on startup. Also provide a "setter", that writes down to the domain object for the next start. Then add your own tag to get easy access to the value(s). In the tag you can also add common things like rendering the value as markdown or fetch by current locale.