title: Add attributes to the model of all controllers in Spring 3
body: <p>Every single view in my Spring 3 app has a set of attributes they can rely on.  So the first line of every controller is something like:</p>
  
  <pre><code>ControllerHelper.addDefaultModel(model, personManager, request);
  </code></pre>
  
  <p>In there I'll add</p>
  
  <ul>
  <li>user object and full name retrieved from the database if person is logged in</li>
  <li>set of variables which are typically set once (e.g. <code>imagesHost</code>)</li>
  <li>set of languages a visitor can switch to</li>
  <li>current language</li>
  <li>some statistics (e.g. total # of people in our system)</li>
  </ul>
  
  <p>This all allows each view to display the logged in user's name, easily reference an image location, a list of languages and some overall stats about the site.</p>
  
  <p>So the question is, is the controller model object the best place to store all the data or is there a more convenient place which makes it just as easy for views to access this info?</p>
  
  <p>And secondly, I'd REALLY love not to have to have the <code>ControllerHelper</code> line above as the first line in every controller.  It's actually not always the first line, sometimes I first check if I need to redirect in that controller, because I don't want to waste resources filling the model for no reason.  Maybe a filter or annotation or some Spring callback mechanism could make sure the <code>ControllerHelper</code> code is called <strong>after</strong> the controller is finished but right <strong>before</strong> the view is rendered, skipping this if a redirect was returned?</p>