JOHNSON-10 Adding support for Servlet 3-style initialization
Bryan Turner
Branch: JOHNSON-10-bturner-servlet-3-init-support
Branch: master
Merged
Merged pull request
Merged in JOHNSON-10-bturner-servlet-3-init-support (pull request #1)
Merged in JOHNSON-10-bturner-servlet-3-init-support (pull request #1)
I'm upgrading Stash to use
ServletContainerInitializer
-style initialization, replacing ~600 lines ofweb.xml
with a 250 lineWebApplicationInitializer
class.To simplify that work, I need Johnson to leverage Spring 3.1's
ServletContainerInitializer
components better. This involves:Adding constructors on
JohnsonContextLoaderListener
andJohnsonDispatcherServlet
which accept aWebApplicationContext
up frontAdding base classes extending Spring's standard
AbstractContextLoaderInitializer
andAbstractDispatcherServletInitializer
classes to use Johnson-aware componentsThere is some duplication between the Johnson
Initializer
classes due to the hierarchies. I have a fairly narrow set of choices, there. I want to reuse as much of the initialization work done by Spring's classes as possible, so my choices distill down to:Duplicate the methods from
AbstractJohnsonContextLoaderInitializer
inAbstractJohnsonDispatcherServletInitializer
, allowing me to reuse all the SpringMVC initialization fromAbstractDispatcherServletInitializer
Duplicate all of the methods in
AbstractDispatcherServletInitializer
, allowing me to reuse the methods inAbstractJohnsonContextLoaderInitializer
The first option is a fair amount less code, so I've gone that route for the moment.