title: How to set objects on Spring 3.1 MVC controller from an interceptor?
body: <p>I'm having a couple of issues related to interceptors since upgrading to 3.1. In version 3.0.x and earlier I used the following pattern to intercept Spring MVC controllers:</p>
  
  <ol>
  <li>Create an interface called something like RoleAware which defines one or more setters.</li>
  <li>Have one or more controllers implement the interface</li>
  <li>Register a new global interceptor which does a "handler instanceof RoleAware" check in the preHandle</li>
  <li>If the interceptor is an instanceof RoleAware, then set one or more objects on the implementing controller</li>
  </ol>
  
  <p>The first issue is that something changed in 3.1 so the instanceof check fails. I've fixed this by using the new explicit  elements in my servlet context configuration. Not a big deal and a bit cleaner approach than the instanceof check.</p>
  
  <p>The second issue is that when I attempt to cast the handler (Controller) to my RoleAware interface I get a ClassCastException. </p>
  
  <p>I'd like a solution that will enable me to continue to arbitrarily set objects on the intercepted controllers. For example, set a Role object on any Controllers that are intercepted. Also, I'd like to know more about the changes in 3.1 that is causing this to break.</p>