JOHNSON-10 Adding support for Servlet 3-style initialization

Merged
#1 · Created  · Last updated

Merged pull request

Merged in JOHNSON-10-bturner-servlet-3-init-support (pull request #1)

cd4166f·Author: ·Closed by: ·2014-04-09

Description

I'm upgrading Stash to use ServletContainerInitializer-style initialization, replacing ~600 lines of web.xml with a 250 line WebApplicationInitializer class.

To simplify that work, I need Johnson to leverage Spring 3.1's ServletContainerInitializer components better. This involves:

  • Adding constructors on JohnsonContextLoaderListener and JohnsonDispatcherServlet which accept a WebApplicationContext up front

  • Adding base classes extending Spring's standard AbstractContextLoaderInitializer and AbstractDispatcherServletInitializer classes to use Johnson-aware components

There 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:

  1. Duplicate the methods from AbstractJohnsonContextLoaderInitializer in AbstractJohnsonDispatcherServletInitializer, allowing me to reuse all the SpringMVC initialization from AbstractDispatcherServletInitializer

  2. Duplicate all of the methods in AbstractDispatcherServletInitializer, allowing me to reuse the methods in AbstractJohnsonContextLoaderInitializer

The first option is a fair amount less code, so I've gone that route for the moment.

0 attachments

0 comments

Loading commits...