title: Accessing cached objects from view template in Play! 2.1 framework
body: <p>I'm storing logged in User object in Play cache (<code>using play.cache.Cache</code>) like this.</p>
  
  <pre><code>User user = userRepo.findUserFromDB(id);
  String uuid = java.util.UUID.randomUUID().toString();
  Cache.set(uuid, user);
  session("uuid", uuid);
  </code></pre>
  
  <p>I want to use this object in every view I render (to display information about logged in user in the footer template). One way would be to pass this object to views from every controller as an argument, but it's definitely not the way of doing it.</p>
  
  <pre><code>String uuid = session("uuid") 
  User user = Cache.get(uuid);
  return ok(
          dashboard.render(user, other_params)
      );
  </code></pre>
  
  <p>What would be the most elegant way of doing it to maximize code re-use?</p>