views:

80

answers:

1

In Spring Web MVC, the DispatcherServlet has a bunch of flags, such as

detectAllHandlerMappings detectAllHandlerAdapters detectAllHandlerExceptionResolvers detectAllViewResolvers

that allow you to choose between finding all type-matched beans on the app context and finding at most one, matched under a specific ID. They all default to true.

I'm trying to figure out a good use case for these; specifically, are there compelling situations in which I'd set one false?

A: 

For instance, "handlerMapping" is a predefined bean id implicitly used if defined (no explicit wiring needed). If multiple handlerMappings are used and detectAllHandlerMappings == true, Spring will load them by type and multiple URL-to-controller method strategies will be employed

Right, but detectAllHandlerMappings is true by default, and I can see the utility there. It's exactly as you say; you can get multiple mappings strategies going. But I'm looking for cases where it would make sense to set this false...? (As opposed to just providing a single mapping...)
Willie Wheeler