Does Spring Boot support servlet 2.5 auto-configuration?

268 views
Skip to first unread message

Marcel Overdijk via StackOverflow

unread,
Apr 9, 2014, 5:42:10 PM4/9/14
to google-appengin...@googlegroups.com

I would like to create a Spring Boot application to be deployed on Google AppEngine infrastructure. GAE currently only supports servlet 2.5 web applications.

Is it possible to use Spring Boot - using auto-configuration - in combination with a old-fashioned web.xml?

Can I for example use a contextClass/contextConfigLocation pointing to a @Configration class including @EnableAutoConfiguration?

All Spring Boot examples seem to use a simple Application class with main method to run the application. So I would like to know if Spring Boot supports using a web.xml as start point to boot the application?



Please DO NOT REPLY directly to this email but go to StackOverflow:
http://stackoverflow.com/questions/22974475/does-spring-boot-support-servlet-2-5-auto-configuration

Dave Syer via StackOverflow

unread,
Apr 10, 2014, 3:02:24 AM4/10/14
to google-appengin...@googlegroups.com

More than one question there:

  • There's nothing stopping you from using web.xml (it's still part of the Servlet spec). Most people prefer the Java initializers these days.

  • @EnableAutoConfiguration works for any application context (it just uses features of Spring).

  • But Spring Boot out of the box doesn't have a ContextLoaderListener that knows about SpringApplication, so you miss some of the benefits of Boot if you do as you describe. There's one you might find useful here.

There's a sample app here that runs on GAE, currently deployed here: http://dsyerboot.appspot.com/.



Please DO NOT REPLY directly to this email but go to StackOverflow:
http://stackoverflow.com/questions/22974475/does-spring-boot-support-servlet-2-5-auto-configuration/22980862#22980862

Dave Syer via StackOverflow

unread,
Apr 10, 2014, 5:27:30 AM4/10/14
to google-appengin...@googlegroups.com

More than one question there:

  • There's nothing stopping you from using web.xml (it's still part of the Servlet spec). Most people prefer the Java initializers these days.

  • @EnableAutoConfiguration works for any application context (it just uses features of Spring).

  • But Spring Boot out of the box doesn't have a ContextLoaderListener that knows about SpringApplication, so you miss some of the benefits of Boot if you do as you describe. There's one you might find useful here.

  • Spring Boot Actuator relies on a few Servlet 3.0 features here and there so you need workarounds for a 2.5 environment (see this spring-boot-legacy prototype for details).

Reply all
Reply to author
Forward
0 new messages