I'd like to have a bean that runs through all our FreeMarker templates and instantiates a FreeMarkerView for each one, so that the beans are preloaded. There've been a couple other similar optimisations that I'd like to do that require an HttpServletRequest.
So my question is this: is there any normal way in Spring to run an init() method on a Spring bean during the application startup and provide it with some sort of HttpServletRequest? I'd like to avoid mocking out a full HttpServletRequest, and I know I could always setup a controller and open a socket and send a request to it, but I wanted to know if there was any better or more normal way of doing it.
Surely there must be other people who've wanted to set up an HttpServletRequest without making an HTTP request, either at startup or on a scheduled task, etc.?