title: How to pass a session attribute as method argument (parameter) with Spring MVC
body: <p>In short, I want something like:</p>
  
  <pre><code>public String action(@SessionAttribute User user) {..}
  </code></pre>
  
  <p>instead of</p>
  
  <pre><code>public String action(HttpSession session) {
       User user = session.getAttribute("user");
  }
  </code></pre>
  
  <p>Mainly for the sake of:</p>
  
  <ul>
  <li>readability</li>
  <li>unit testing</li>
  </ul>