Class that facilitates collaboration between controllers.
The Spring DispatcherServlet performs an attribute clean-up after an include
so included controllers can't expose request attributes to other controllers
unless you turn this feature off, which usually isn't a good idea.
Another level of complexity comes into play when you want to cache the output
of a controller that contributes information needed by other collaborators.
If a cached version is served, the controller's handleRequest() method is not
invoked (which after all is the purpose of a cache), therefore the controller
has no chance to set any request attributes.
One solution would be to cache the dependent controller too. |