Before I get into this, I'm willing to accept that what I'm doing is wrong (very old code). If so feel free to close this.
I have a OncePerRequestFilter that is invoked in the Spring Security chain after the FORM_LOGIN_FILTER filter. Inside this filter, the code decides whether some conditions are true and if so it redirects the user to a new page:
In RedirectView's renderMergedOutputModel method, a null pointer exception (silently for some reason) occurs because the following line returns null:
Having thrown some breakpoints around it seems to be because the DispatcherServlet hasn't added the FlashMapManager into the request as the filter was invoked before the DispatcherServlet.
I can get around this by overriding renderMergedOutputModel and taking out the stuff about flash attributes as I do not need them.
Again, happy to be told I'm "doing it wrong".