title: How to NOT add HandlerMapping to Spring DispatchServlet
body: <p>I have a SpringMVC application. It has in it a custom class that extends DefaultAnnotationHandlerMapping. This class is used for some meta tools to generate reports and tools for use with the API of the MVC app. It is NOT needed to be used by the DispatchServlet.</p>
  
  <p>I am in the process of upgrading this system from Spring 3.2 to 4.1. One of the results of this upgrade is that the order of the HandlerMappers in the DispatchServlet changed. The custom class is now higher in priority than the RequestMappingHandlerMapping that we get the proper handler from.</p>
  
  <p>So my question is:</p>
  
  <ol>
  <li>Is there a way to ensure that the custom class NOT be added to the Dispatcher at all? I have not configured it to do so. I assume Spring is just picking it up because it is a HandlerMapping</li>
  <li>If not where is the best place to set the Order so I can push it lower. AbstractHandlerMapping has made the getter and setter for order final (So I can't override the getter). I attempted to set a low priority in the constructor of the custom class but apparently spring then resets it back to 0 later on.</li>
  </ol>